Before iOS 16 picker views take on special behavior when inside forms. They looked like a navigation link which takes you to a new screen where you can choose an option.
Since iOS 16 it seems, that this behavior was removed.
Is there a possibility to get the "old" behavior?
e.g. this code
struct ContentView: View {
@State private var selectedValue = "One"
let counts = ["One", "Two", "Three"]
var body: some View {
NavigationView {
Form {
Section {
Picker("Selection", selection: $selectedValue) {
ForEach(counts, id: .self) {
Text($0)
}
}
}
}
}
}
}
results in this behavior (since iOS 16)
instead of this (before iOS 16)
Thanks!!!
2
Answers
iOS 16 added
NavigationLinkPickerStyle
which has the pre iOS 16 behavior.I’m in a similar boat, I’m currently downloading the 14.1 Beta of Xcode, however it WOULD be nice if you could have the menu style picker but also have it display nothing. It’s almost as if you already have something selected, but you don’t. It causes confusion with the user.