Fix navigation on iOS 16
This commit is contained in:
@@ -1,9 +1,12 @@
|
|||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
public func NavigationStackCompat(@ViewBuilder content: () -> some View) -> some View {
|
public func NavigationStackCompat<T>(@ViewBuilder content: () -> T) -> some View where T: View{
|
||||||
viewBuilder {
|
viewBuilder {
|
||||||
if #available(iOS 16.0, macOS 13.0, tvOS 16.0, *) {
|
if #available(iOS 17.0, *) {
|
||||||
NavigationStack(root: content)
|
// view not updating in iOS 16, but why?
|
||||||
|
NavigationStack {
|
||||||
|
content()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
NavigationView(content: content)
|
NavigationView(content: content)
|
||||||
#if !os(macOS)
|
#if !os(macOS)
|
||||||
|
|||||||
Reference in New Issue
Block a user