Added support for iOS 15.
This commit is contained in:
parent
a6f8add14a
commit
6ca509f7fb
3 changed files with 35 additions and 3 deletions
32
dns/NavigationCompat.swift
Normal file
32
dns/NavigationCompat.swift
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
//
|
||||
// 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
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue