iOS

ios 判断应用是否被允许使用gps功能

2015-10-31  本文已影响74人  lkqin

// Swift:
let status = CLLocationManager.authorizationStatus() //应用gps状态
// status : 0没有操作 2拒绝 3允许一直 4 允许打开时
Gpsflag = CLLocationManager.locationServicesEnabled()//应用是否开启gps功能
if Gpsflag == true{
if status.rawValue == 3 || status.rawValue == 4 {
Gpsflag = true
}else{
Gpsflag = false
}
}

上一篇 下一篇

猜你喜欢

热点阅读