URL Scheme “Open Settings” ios

后端 未结 5 1916
后悔当初
后悔当初 2020-12-05 03:05

I know this question has been asked so many times. The answers say that this is not available in Xcode > 5.x. but I saw some apps that can use this(Go to Settings)(iOS7). Is

5条回答
  •  生来不讨喜
    2020-12-05 03:16

    iOS 13, Swift 5.0

    Syntax for open settings changed [again] a tiny bit.

    if let url = URL(string:UIApplication.openSettingsURLString) {
         if UIApplication.shared.canOpenURL(url) {
           UIApplication.shared.open(url, options: [:], completionHandler: nil)
         }
      }
    

提交回复
热议问题