0

Is there any way to enable the option of settings "Speak Screen" on iPhone programmatically with Swift?

enter image description here

Vincent
  • 486
  • 6
  • 20

2 Answers2

0

You can only open settings app

  guard let settingsUrl = URL(string: UIApplicationOpenSettingsURLString) else {
            return
        }

        if UIApplication.shared.canOpenURL(settingsUrl) {
            if #available(iOS 10.0, *) {
                UIApplication.shared.open(settingsUrl, completionHandler: { (success) in
                    print("Settings opened: \(success)") // Prints true
                })
            } else {
                // Fallback on earlier versions
            }
        }
Shehata Gamal
  • 98,760
  • 8
  • 65
  • 87
  • Thanks, @Sh_Khan. As you know, there are some SettingsURL schemes, which you can find here: https://gist.github.com/tzmartin/b7019c22fc3152a0b2fe. But it seems there is no one for Speak Screen. I wonder if there is any way to create a custom URL Scheme by myself? – Vincent Feb 27 '18 at 10:38
  • the only thing that works is open touch with **App-prefs:root=TOUCHID_PASSCODE** – Shehata Gamal Feb 27 '18 at 10:55
  • Thanks. Any way, the Settings URL Schemes have been abandoned in iOS 11. – Vincent Feb 27 '18 at 13:46
0

You can still open Settings iOS11:

if let settings = URL(string: "App-Prefs:root=General&path=ACCESSIBILITY/SPEECH"), 
UIApplication.shared.canOpenURL(settings) {
   UIApplication.shared.open(settings, options: [UIApplication.OpenExternalURLOptionsKey.universalLinksOnly : false]) { (success) in
         print("open settings: \(success)")
   }
}

Here are different Settings paths from another answer:

App-Prefs:root=General&path=About
App-Prefs:root=General&path=ACCESSIBILITY
App-Prefs:root=AIRPLANE_MODE
App-Prefs:root=General&path=AUTOLOCK
App-Prefs:root=General&path=USAGE/CELLULAR_USAGE
App-Prefs:root=General&path=Bluetooth
App-Prefs:root=General&path=DATE_AND_TIME
App-Prefs:root=FACETIME
App-Prefs:root=General
App-Prefs:root=General&path=Keyboard
App-Prefs:root=CASTLE
App-Prefs:root=CASTLE&path=STORAGE_AND_BACKUP
App-Prefs:root=General&path=INTERNATIONAL
App-Prefs:root=LOCATION_SERVICES
App-Prefs:root=ACCOUNT_SETTINGS
App-Prefs:root=MUSIC
App-Prefs:root=MUSIC&path=EQ
App-Prefs:root=MUSIC&path=VolumeLimit
App-Prefs:root=General&path=Network
App-Prefs:root=NIKE_PLUS_IPOD
App-Prefs:root=NOTES
App-Prefs:root=NOTIFICATIONS_ID
App-Prefs:root=Phone
App-Prefs:root=Photos
App-Prefs:root=General&path=ManagedConfigurationList
App-Prefs:root=General&path=Reset
App-Prefs:root=Sounds&path=Ringtone
App-Prefs:root=Safari
App-Prefs:root=General&path=Assistant
App-Prefs:root=Sounds
App-Prefs:root=General&path=SOFTWARE_UPDATE_LINK
App-Prefs:root=STORE
App-Prefs:root=TWITTER
App-Prefs:root=General&path=USAGE
App-Prefs:root=VIDEO
App-Prefs:root=General&path=Network/VPN
App-Prefs:root=Wallpaper
App-Prefs:root=WIFI
App-Prefs:root=INTERNET_TETHERING
pesch
  • 1,976
  • 2
  • 17
  • 29