So is there any elegant way to find out if it's being evaluated the second time? Actually I have drawn a grid in that method, so I have used range loop to draw it. It crashes the view because of those 0s. I saw a similar post on stackoverflow and it mentions what you have mentioned too.
swift
private func draw_lines_of_quadrant(screen_width: CGFloat, screen_height: CGFloat) - some View {
Path { path in
/* Horizontal lines along x-axis */
for y_coord in Int(m_y_space_offset)..Int(screen_height) {
/* This coordinate should not exceed the input width */
if y_coord Int(screen_height) && y_coord % Int(m_x_space_offset) == 0 {
path.move(to: CGPoint(x: m_x_space_offset, y: max(m_y_space_offset, CGFloat(y_coord) - m_y_space_offset)))
path.addLine(to: CGPoint(x: screen_width - m_x_space_offset, y: max(m_y_space_offset, CGFloat(y_coord) - m_y_space_offset)))
}
}
/* Vertical lines along y-axis */
for x_coord in Int(m_x_space_offset)..Int(screen_width) {
if x_coord (Int(screen_width) - Int(m_x_space_offset)) && x_coord % Int(m_y_space_offset) == 0 {
path.move(to: CGPoint(x: CGFloat(x_coord), y: m_y_space_offset))
path.addLine(to: CGPoint(x: CGFloat(x_coord), y: max(0, screen_height - m_y_space_offset)))
}
}
}
.stroke(Color.black, lineWidth: m_stroke_width)
.colorInvert()
}
Thanks for replying.
Post
Replies
Boosts
Views
Activity
Thank you very much. Yes it's hard to read and kind of rough as am still learning Swift/SwiftUI
Thanks again
Just found out that you have to check both width and height against 0. Looks like either one can be zero too, that's what I just found out
Same here from Nepal too. I always get:
We are unable to process your request. An unknown error occurred.
I have contacted them so many times, they replied the first time and told me to try again. But now they don't even reply, even if I create new tickets to communicate with them. Never expected this from Apple support