Working with Maps
The longer it takes to develop, the less likely it is to launch.
-Jason Fried, Basecamp
The MapKit framework provides APIs for developers to display maps, navigate through maps, add annotations for specific locations, add overlays on existing maps, etc. With the framework, you can embed a fully functional map interface into your app without any coding.
Starting from iOS 9, the MapKit framework allows developers to provide pin customization, transit and flyover support. In iOS 11, Apple introduced a new MarkerAnnotationView that gives the annotation a modern look. I will go over some of these features with you. In particular, you will learn a few things about the framework:
- How to embed a map in a view and a table view cell
- How to translate an address into coordinates using Geocoder
- How to add and customize a pin (i.e. annotation) on map
- How to customize an annotation
To give you a better understanding of the MapKit framework, we will add a map feature to the FoodPin app. After the change, the app will display a small map view in the detail screen. When a user taps that map view, the app will further bring up an interactive map that takes up the whole screen.
Cool, right? It's gonna be fun. Let's get started.
To continue reading and access the full version of the book, please get the full copy here. You will also be able to access the full source code of the project.