From the course: iOS Development Tips

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Use markers instead of pins for map annotations

Use markers instead of pins for map annotations

From the course: iOS Development Tips

Use markers instead of pins for map annotations

- [Narrator] For as long as there's been a map in iOS, there's been pins. The map of pizza restaurants in Chicago I have here has those multicolor pins you've seen before. While you can still use them, iOS11 changes pins to something far more flexible and useful: Markers. I'll show you how to use markers. You'll find a starter file on GitHub. When you open the code, you'll find model of pizza annotations which creates an array of pizza restaurants as annotations. If you want to learn more, take a look at the course Advanced iOS App Development: MapKit and Core Location. I'm going to assume you're familiar with annotations. To get a marker, I zoom down here to the MapView, viewFor annotation code, and I'm going to change all the pin annotation views to marker annotation views. And that's just as easy as changing pin to marker. That will make the annotation views here wrong because we cast them to pin annotation views, so I'll change those too, and we'll get one more error, since…

Contents