There's something I don't really understand about the transition from NavigationView
to NavigationStack
for SwiftUI 4 and iOS 16.
I have 2 applications running on the App Store (targeting iOS 15 and above) and of course I'm using NavigationView
. This weekend, I was looking for a solution to have them ready for iOS 16 by replacing:
var body: some View {
NavigationView {
ScrollView { /* code here */ }
}
}
To something like this:
var body: some View {
if #available(iOS 16, *) {
NavigationStack {
} else {
NavigationView {
}
ScrollView { /* code here */ }
}
}
But finally, before doing so, I tried them with iOS 16 Beta and they're perfectly fine. I don't understand, I thought it would be total a mess but finally no. Do you have an explanation? Maybe, deprecated isn't what it should mean?