选择了wifi蜂窝数据后调用
【选择了wifi蜂窝数据后调用】有权限后去调用
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
//...
self.networkStatus(application, didFinishLaunchingWithOptions: launchOptions)
//...
return true
}
func networkStatus(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) {
if #available(iOS 9.0, *) {
let cellularData = https://www.it610.com/article/CTCellularData()
cellularData.cellularDataRestrictionDidUpdateNotifier = { (state) in
switch state {
case .restrictedStateUnknown:
breakcase .restricted:
breakcase .notRestricted:
self.todo()
break
}
}
}
else {
self.todo()
}
}
推荐阅读
- 热闹中的孤独
- 2018-02-06第三天|2018-02-06第三天 不能再了,反思到位就差改变
- 尽力
- 你到家了吗
- 这辈子我们都不要再联系了
- 死结。
- 我从来不做坏事
- 时间老了
- 喂,你结婚我给你随了个红包
- 赢在人生六项精进二阶Day3复盘