![](/img/trans.png)
[英]ios how to monitor enter or exit on polygon or rectangle region using geofencing
[英]Is it possible to create and get triggers (enter and exit) for polygon geofencing in iOS
我想創建一個應用程序,當用戶點擊mapview時,它將為該位置創建地理圍欄(可以是圓形,多邊形或任何類型)。 每當用戶進入或退出創建的區域時,我都希望得到通知。 我設法用圓形區域實現,但也想用多邊形或用戶定義的區域來實現。
請提出建議。
使用CLLocationManager:創建一個區域並使用startMonitoringForRegion:
對其進行startMonitoringForRegion:
。 對於通知,請使用委托方法
locationManager:didEnterRegion:
locationManager:didExitRegion:
locationManager:didDetermineState:forRegion:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.