Getting Started with Core Location and MapKit
In the previous chapter, you learned how to pass data from the Add New Journal Entry screen to the Journal List screen, and from the Journal List screen to the Journal Entry Detail screen. You also learned about the UITextFieldDelegate
and UITextViewDelegate
methods.
In this chapter, you’ll learn how to get your device location using Apple’s Core Location framework, and how to set map regions, display map annotations, and create map snapshots using Apple’s MapKit framework. This will come in handy if you’re planning to build apps that use maps, such as Apple Maps or Waze.
First, you’ll modify the Add New Journal Entry screen so that the user can add their current location to a new journal entry. Next, you’ll create a MapViewController
class (a view controller for the Map screen) and configure it to display a map region centered on your location. Then, you’ll update the JournalEntry...