Use the MKMapView delegate to change the color of the pin.
- [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 annotation.…You'll see that it takes an annotation…
- Getting coordinates from the web
- Working with Core Location data types and regions
- Creating a map in 2D, 3D, satellite, and flyover views
- Adding annotations
- Adding overlays
- Finding the current location
- Tracking heading, speed, and region
- Searching for locations
- Requesting and displaying directions
Skill Level Advanced
Advanced iOS Development: Working with APIswith Saul Mora1h 59m Intermediate
1. Basic Map and Location Concepts
5. Current Location
6. Heading, Speed, and Regions
Next steps1m 38s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.