【发布时间】:2019-02-22 23:59:52
【问题描述】:
我正在尝试连接到应用程序内的 wifi 网络。使用下面的代码:
let hotspotConfig = NEHotspotConfiguration(ssid: "testNetwork")
hotspotConfig.joinOnce = true
NEHotspotConfigurationManager.shared.apply(hotspotConfig) { (configurationError) in
if configurationError != nil {
print("error")
print(configurationError!.localizedDescription)
} else {
print("success")
}
}
但当我无法加入网络时,我会收到 Alert 提示: "无法加入网络testNetwork"
我的问题是,如果我无法连接,有什么方法可以不显示警报?
【问题讨论】:
-
你找到解决办法了吗?
标签: ios swift networking