32 lines
620 B
Swift
32 lines
620 B
Swift
//
|
|
// NavigationCompat.swift
|
|
// dns
|
|
//
|
|
// Created by Benjamin Erhart on 15.04.26.
|
|
//
|
|
import SwiftUI
|
|
|
|
struct NavigationCompat<Content: View>: View {
|
|
|
|
let content: () -> Content
|
|
|
|
init(@ViewBuilder content: @escaping () -> Content) {
|
|
self.content = content
|
|
}
|
|
|
|
var body: some View {
|
|
if #available(iOS 16.0, macOS 13.0, *) {
|
|
NavigationStack {
|
|
content()
|
|
}
|
|
}
|
|
else {
|
|
NavigationView {
|
|
content()
|
|
}
|
|
#if !os(macOS)
|
|
.navigationViewStyle(StackNavigationViewStyle())
|
|
#endif
|
|
}
|
|
}
|
|
}
|