I have added Apple's new MKUserTrackingButton
to my app on a map view. It works fine when the user has previously given permission to use location services (e.g. CLAuthorizationStatus.authorizedWhenInUse
).
However, when the user has denied permission or the permission status is undetermined, the user tracking button turns into an activity indicator (aka spinner) and never stops spinning.
Instead, I would like to show the iOS permission alert like in the Apple Maps app or at least some kind of alert to give the user a hint why it's not working. Naturally, I also want the activity indicator to stops and to turn back into the default "compass needle" icon.
Unfortunately, MKUserTrackingButton
is not a sublass of UIButton
so I cannot add any targets to it and there seems to be no API to change the visual status of the button.
Any idea how to do this?
locationManager.location
– Grimonia