Вы можете проверить, поддерживается ли локаль supportedLocales
// Locales which support speech recognition.
// Note that supported does not mean currently available; some locales
// may require an internet connection, for example.
+ (NSSet<NSLocale *> *)supportedLocales;
let locale = Locale(identifier: "hi-IN")
SFSpeechRecognizer.supportedLocales().contains(locale) // Can check using this
let sr = SFSpeechRecognizer(locale: locale)
sr?.isAvailable // Can check using this
lazy var srf: SFSpeechRecognizer? = {
let locale = Locale(identifier: "hi-IN")
return SFSpeechRecognizer.supportedLocales().contains(locale) ? SFSpeechRecognizer(locale: locale) : nil
}()