fall back to the tutorial menu on ios 17

This commit is contained in:
leminlimez committed 2025-07-13 14:43:11 -04:00
1 parent dfee862746
commit 99eba91bad
2 files changed
+5

No files matched your search

@@ -35,6 +35,7 @@ class PosterBoardManager: ObservableObject {
guard let obj = objc_getClass("IPSettingsUtilities") as? NSObject else { return false } guard let obj = objc_getClass("IPSettingsUtilities") as? NSObject else { return false }
langManager = obj langManager = obj
} else { } else {
// TODO: Need to find the correct class for this on iOS 17
guard let obj = objc_getClass("PSLanguageSelector") as? NSObject else { return false } guard let obj = objc_getClass("PSLanguageSelector") as? NSObject else { return false }
langManager = obj langManager = obj
} }
+4
View File
@@ -99,6 +99,7 @@ struct ContentView: View {
.buttonStyle(TintedButton(color: .blue, fullwidth: true)) .buttonStyle(TintedButton(color: .blue, fullwidth: true))
} }
Button(action: { Button(action: {
if #available(iOS 18.0, *) {
guard let lang = UserDefaults.standard.stringArray(forKey: "AppleLanguages")?.first else { guard let lang = UserDefaults.standard.stringArray(forKey: "AppleLanguages")?.first else {
hideResetHelp = false // fallback to tutorial hideResetHelp = false // fallback to tutorial
return return
@@ -110,6 +111,9 @@ struct ContentView: View {
UIApplication.shared.alert(body: "The API failed to call correctly.\nSystem Locale Code: \(lang)") UIApplication.shared.alert(body: "The API failed to call correctly.\nSystem Locale Code: \(lang)")
} }
}, noCancel: false) }, noCancel: false)
} else {
hideResetHelp = false
}
}) { }) {
Label("Reset Collections", systemImage: "arrow.clockwise.circle") Label("Reset Collections", systemImage: "arrow.clockwise.circle")
} }