Is there any convenient way to back deploy the NavigationStack or NavigationSplitView??
The real problem is if I want to back support iOS 15 or 14, I must conditionally switch between NavigationView and NavigationStack / NavigationSplitView.
Here is how I did for NavigationStack, but I have no idea how to deal with NavigationSplitView
import SwiftUI
struct NavigationStack<Content: View>: View {
var content: () -> Content
var body: some View {
if #available(iOS 16.0, macOS 13.0, *) {
SwiftUI.NavigationStack {
content()
}
} else {
NavigationView {
content()
}.navigationViewStyle(.stack)
}
}
}
Will the new NavigationStack and NavigationSplitView back support old devices? I think these behaviors in previous OS is not new features.