I'm still just feeling out SwiftUI, so maybe someone can tell me if I'm missing something obvious.
My Pickers on Apple Watch always seem to crash my app when scrolling all the way up to the first option, then attempting to scroll down even a frame. The console output seems familiar from pre-SwiftUI:
*** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan nan].I've reduced this to the simplest SwiftUI Picker I can imagine, and it still crashes.
struct TestPicker: View {
@State var test: Int = 1
var body: some View {
Picker("Pick!", selection: $test) {
ForEach(1...3, id: \.self) { value in
Text(String(value))
}
}
}
}
All right – inferring the crash had something to do with view geometry, I've at least prevented the crash by adding a `.fixedSize()` modifier to the dynamic `Text()` views. I still only have the vaguest idea why that would help, or why a crash occurred in the first place.