So is there any elegant way to find out if it's being evaluated the second time?
Always be ready for being evaluated multiple times.
It crashes the view because of those 0s.
You may need to make your method 0-size-tolerant.
(Your code looks like an old C-code and very hard to read. I strongly recommend you to follow the modern coding rules. You are writing code in Swift, not C.)
var body: some View {
NavigationView {
GeometryReader { geometryProxy in
VStack {
ZStack {
if geometryProxy.size != .zero {
draw_lines_of_quadrant(screen_width: geometryProxy.size.width, screen_height: geometryProxy.size.height)
}
}
}
}
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: