作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想从我的 iOS 应用程序打开 WIFI 设置部分,我的代码在 Swift 3 和 iOS 9.2 之前运行良好
if let settingsURL = URL(string: AppSettingsWifiUrl) {
UIApplication.shared.openURL(settingsURL)
}
最佳答案
我们不能再在 iOS 11 上这样做了,我们可以打开设置:
if let url = URL(string:UIApplicationOpenSettingsURLString) {
if UIApplication.shared.canOpenURL(url) {
let url = UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
}
关于swift3 - 如何在 Swift 3 中打开 WIFI 设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39764553/
我是一名优秀的程序员,十分优秀!