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

后端 未结 7 1101
失恋的感觉
失恋的感觉 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-17 23:54

    For Swift:

    let url = URL(string: "App-Prefs:root=WIFI")
    
        if UIApplication.shared.canOpenURL(url!){
            UIApplication.shared.openURL(url!)
    
        }
    

提交回复
热议问题