基于此链接,https://stackoverflow.com/a/28152624/743663您可以打开ACCESSIBILITY设置,但是我可以使用ACCESSIBILITY-> Speech-Voice之类的URL设置进行更多研究吗?
我的应用程序使用文本进行语音转换,因此我希望用户转到语音设置以轻松下载增强型语音。
我想没有办法以编程方式下载增强的声音,所以我至少想轻松地显示设置屏幕。
这是打开访问权限的方法。
override func viewDidAppear(_ animated: Bool) {
let alertController = UIAlertController (title: "Title", message: "Go to Settings?", preferredStyle: .alert)
let settingsAction = UIAlertAction(title: "Settings", style: .default) { (_) -> Void in
guard let settingsUrl = URL(string: UIApplicationOpenSettingsURLString) else {
return
}
if UIApplication.shared.canOpenURL(settingsUrl) {
UIApplication.shared.open(settingsUrl, completionHandler: { (success) in
print("Settings opened: \(success)") // Prints true
})
}
}
alertController.addAction(settingsAction)
let cancelAction = UIAlertAction(title: "Cancel", style: .default, handler: nil)
alertController.addAction(cancelAction)
present(alertController, animated: true, completion: nil)
}
我尝试过“ App-Prefs:root = General&path = ACCESSIBILITY&@ path = SPEECH”,但没有用。
swift 5:ios 13
尝试:-App-prefs:root = General&path =可访问性/语音覆盖/语音
为我工作