Merge pull request #141 from kkebo/older-sdks

fix: support older iOS SDKs again
This commit is contained in:
Kenta Kubo 2025-09-06 22:01:58 +09:00 committed by GitHub
commit f3feb893e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 10 deletions

View file

@ -189,12 +189,14 @@ extension ContentView: View {
.navigationTitle(Bundle.main.displayName!)
.navigationBarTitleDisplayMode(self.navigationBarTitleDisplayMode)
.toolbar {
if #available(iOS 26, *) {
ToolbarItem(placement: .subtitle) {
self.statusIndicator
.foregroundStyle(.secondary)
#if canImport(SwiftUI, _version: 7)
if #available(iOS 26, *) {
ToolbarItem(placement: .subtitle) {
self.statusIndicator
.foregroundStyle(.secondary)
}
}
}
#endif
self.toolbarContent
}
.alert(self.alertTitle, isPresented: self.$isAlertPresented) {
@ -323,6 +325,9 @@ extension ContentView: View {
}
ToolbarItem(placement: .status) {
if #available(iOS 26, *) {
#if !canImport(SwiftUI, _version: 7)
self.statusIndicator
#endif
} else {
self.statusIndicator
}

View file

@ -38,15 +38,21 @@ extension DetailView: View {
HowToActivateView()
.toolbar {
ToolbarItem(placement: .cancellationAction) {
if #available(iOS 26, *) {
Button("Close", systemImage: "xmark", role: .close) {
self.isGuidePresented = false
#if canImport(SwiftUI, _version: 7)
if #available(iOS 26, *) {
Button("Close", systemImage: "xmark", role: .close) {
self.isGuidePresented = false
}
} else {
Button("Close", systemImage: "xmark", role: .cancel) {
self.isGuidePresented = false
}
}
} else {
#else
Button("Close", systemImage: "xmark", role: .cancel) {
self.isGuidePresented = false
}
}
#endif
}
}
}