From the course: Advanced iOS App Development: MapKit & Core Location
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
MKMapView delegate - iOS Tutorial
From the course: Advanced iOS App Development: MapKit & Core Location
MKMapView delegate
- [Instructor] With the annotation so far, you've gotten a red pin with a callout for the title and subtitle. We'd like to customize annotations a lot more than this. You'll need to work with the MKMapViewDelegate to do that. Let's go stopping the app. Give yourself a bit more room by closing some stuff up for the moment. Go to the ViewController class. We're going to go ahead and adapt a new delegate, the MKMapViewDelegate. And, as with any delegate, go down to viewDidLoad(). Just under the super.viewDidLoad() put mapView.delegate. Just like every other delegate method, we're going to tell it that we're going to do its delegate methods right here in self. K. I've actually set up for you somewhere to do that. If you click down a little bit, you'll see that I actually have some annotation delegates marks already made. Go down to that, and in there we're going to add mapView. There's a whole bunch of them here. You may have to go down the list a little bit, but we're looking for viewFor…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.