I'm using a wheel style picker in a form that I navigate to using a NavigationLink. When I rotate the wheel, the app crashes. If I remove the form in SubForm, the crash disappears, but then the looks are completely different. I'd like the looks of the form, but obviously I don't want the crash. Any suggestions? (iOS15 in a simulator using Xcode 13)
struct SubForm: View {
@State private var selection = 1
var body: some View {
Form {
Section(header: Text("Another title")) {
Picker("Pick me", selection: $selection) {
Text("First item").tag(0)
Text("Second item").tag(1)
}.pickerStyle(.wheel)
}
}
}
}
struct ContentView: View {
var body: some View {
NavigationView {
Form {
Section(header: Text("A title")) {
NavigationLink("Subview", destination: { SubForm() })
}
}
}
}
}