From 6ca509f7fb105534dd8db2e44481a29d2f66f79c Mon Sep 17 00:00:00 2001 From: Benjamin Erhart Date: Wed, 15 Apr 2026 12:51:00 +0200 Subject: [PATCH] Added support for iOS 15. --- dns.xcodeproj/project.pbxproj | 4 ++-- dns/HomeView.swift | 2 +- dns/NavigationCompat.swift | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 dns/NavigationCompat.swift diff --git a/dns.xcodeproj/project.pbxproj b/dns.xcodeproj/project.pbxproj index 1e2384a..8fdd3ee 100644 --- a/dns.xcodeproj/project.pbxproj +++ b/dns.xcodeproj/project.pbxproj @@ -269,7 +269,7 @@ INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 16.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -305,7 +305,7 @@ INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 16.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/dns/HomeView.swift b/dns/HomeView.swift index 765a48c..36b4b63 100644 --- a/dns/HomeView.swift +++ b/dns/HomeView.swift @@ -48,7 +48,7 @@ struct HomeView: View { private let privacyPolicyURL = URL(string: "https://www.sr2.uk/privacy")! var body: some View { - NavigationStack { + NavigationCompat { List { // Main toggle section diff --git a/dns/NavigationCompat.swift b/dns/NavigationCompat.swift new file mode 100644 index 0000000..494bb6a --- /dev/null +++ b/dns/NavigationCompat.swift @@ -0,0 +1,32 @@ +// +// NavigationCompat.swift +// dns +// +// Created by Benjamin Erhart on 15.04.26. +// +import SwiftUI + +struct NavigationCompat: 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 + } + } +}