MKMapView constantly monitor heading

后端 未结 4 1045
耶瑟儿~
耶瑟儿~ 2021-01-16 00:44

I\'m rendering some content in a layer that sits on top of my MKMapView. The whole thing works great with the exception of rotation. When a user rotates the map

4条回答
  •  无人及你
    2021-01-16 01:17

    I've seen similar behavior in a MapKit program for OS X. I'm using the call mapView:regionDidChangeAnimated: instead of a KVO notification on changes to heading, but I'm still only seeing the call at the end of rotations.

    I just tried implementing mapView:regionWillChangeAnimated:. That does in fact get called at the beginning of rotations. Perhaps you could begin polling the region upon receipt of mapView:regionWillChangeAnimated:, cease polling on mapView:regionDidChangeAnimated:, and in between do whatever critical updates you need during the rotations.

提交回复
热议问题