How to programmatically open the WIFI settings in Objective-C on iOS 10

后端 未结 7 1079
失恋的感觉
失恋的感觉 2020-12-17 23:43

The following code works fine on iOS 9, see this post. But it doesn\'t work on iOS 10. How to open WIFI settings programmatically on iOS 10

[[UIApplication s         


        
相关标签:
7条回答
  • 2020-12-18 00:16
     let url=URL(string: "App-Prefs:root=WIFI")
    // you can change root as your requirements 
            if UIApplication.shared.canOpenURL(url!)
            {
                UIApplication.shared.open(url!, options: [:], completionHandler: {success in
    
                })
    
            }
            else{
                UIApplication.shared.open(url!, options: [:], completionHandler: {success in
    
                })
            }
    
    0 讨论(0)
提交回复
热议问题