Opening the Settings app from another app

前端 未结 17 2195
傲寒
傲寒 2020-11-22 01:37

Okay, I know that there are many question about it, but they are all from many time ago.

So. I know that it is possible because the Map app does it.

In the M

17条回答
  •  盖世英雄少女心
    2020-11-22 02:00

    Swift 3:

    guard let url = URL(string: UIApplicationOpenSettingsURLString) else {return}
    if #available(iOS 10.0, *) {
      UIApplication.shared.open(url, options: [:], completionHandler: nil)
    } else {
      // Fallback on earlier versions
      UIApplication.shared.openURL(url)
    }
    

提交回复
热议问题