Hide Apple Translate if not yet on iOS 17.4

The Apple Translate option is hidden if the user hasn't updated their
phone to at least iOS 17.4. If the Apple Translate option is selected
but the user has downgraded to before iOS 17.4, the standard instance
option is selected.
This commit is contained in:
Paul Schuetz 2024-05-09 15:03:07 +02:00
parent 40a11061b7
commit b228c1e36b
No known key found for this signature in database
GPG key ID: 4FDE1FB89050039E
2 changed files with 9 additions and 1 deletions

View file

@ -54,7 +54,11 @@ struct TranslationSettingsView: View {
@Bindable var preferences = preferences
Picker("settings.translation.preferred-translation-type", selection: $preferences.preferredTranslationType) {
ForEach(TranslationType.allCases, id: \.self) { type in
Text(type.description).tag(type)
if #available(iOS 17.4, *) {
Text(type.description).tag(type)
} else if type != .useApple {
Text(type.description).tag(type)
}
}
}
#if !os(visionOS)

View file

@ -71,6 +71,10 @@ import SwiftUI
}
sharedDefault.removeObject(forKey: "always_use_deepl")
}
if #unavailable(iOS 17.4),
preferredTranslationType == .useApple {
preferredTranslationType = .useServerIfPossible
}
}
}