Silver Challenge: Displaying the User’s Region
Display and zoom in on the user’s location on the map. MKMapView has a mechanism for displaying a blue dot annotation on the map, but there is no built-in way to zoom in on that location. To get this to work, you will need to do a few things:
-
Add a “Privacy – Location When In Use Usage Description” key to your application’s Info.plist. This key is associated with a description that tells your users why you will be accessing their location information. See Chapter 15 for another example of adding a privacy description to your applications.
-
Ask the user for permission to find their location. You will need to add a property to MapViewController for a CLLocationManager instance and call ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access