iOS app跳转到设置权限页面

       代码很简单,这里就不做说明了

   OC:

  NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];

              if ([[UIApplication sharedApplication] canOpenURL:url])

              {

                [[UIApplication sharedApplication] openURL:url];

              }

swift:

let url = URL(string: UIApplication.openSettingsURLString)

        if UIApplication.shared.canOpenURL(url! ) {

            UIApplication.shared.open(url!, options: [ : ], completionHandler: nil)

        }

      

猜你喜欢

转载自blog.csdn.net/ForeverMyheart/article/details/114323716