Added support for iOS 15.

This commit is contained in:
Benjamin Erhart 2026-04-15 12:51:00 +02:00
parent a6f8add14a
commit 6ca509f7fb
3 changed files with 35 additions and 3 deletions

View 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
}
}
}