【发布时间】:2018-06-14 02:46:50
【问题描述】:
我从这里下载项目
https://www.raywenderlich.com/136165/core-location-geofencing-tutorial
并根据需求进行了少量修改
-
xcode 说缺少描述,所以我在 info.plist 中添加这些
隐私 - 始终定位和使用时使用说明
隐私 - 使用时的位置使用说明
-
在
GeotificationsViewController我修改了这个func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) { mapView.showsUserLocation = 状态 == .authorizedAlways||状态 == .authorizedWhenInUse }
当我授予authorizedAlways 时,一切正常,但是当authorizedWhenInUse 被授予时,它不会提供didEnterRegion 和didExitRegion
应用在两种情况下都处于打开状态、正在运行、处于活动状态、在屏幕上可见。
xcode 9.2 版, iOS 11.2
【问题讨论】:
标签: ios swift geolocation core-location geofencing