Search code examples
iosiphoneswift3

Any way to open ACCESSIBILITY->Speech-Voice settings in iOS programmatically?


Based on this link, https://stackoverflow.com/a/28152624/743663 you can open ACCESSIBILITY settings, but can I dig into more with URL settings like ACCESSIBILITY->Speech-Voice?

My app uses text to speech, so I want users to go to the voice settings to download enhanced voices easily.

I guess there is no way to download enhanced voices programmatically, so I want to show the settings screen easily at least.

This is the way to open ACCESSIBILITY.

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)
}

I tried "App-Prefs:root=General&path=ACCESSIBILITY&@path=SPEECH", but it didn't work.


Solution

  • swift 5: ios 13

    try this:- App-prefs:root=General&path=ACCESSIBILITY/VOICEOVER/Speech

    work for me