Follow along at https://www.hackingwithswift.com/100/61.
This day covers the second and final part of
Project 16: Capital Cities
in Hacking with Swift.I previously created projects alongside Hacking with Swift in a separate repository, and you can find Project 16 here. Even better, though, I copied it over to Day 60's folder so I could extend it for 100 Days of Swift.
With that in mind, Day 61 focuses on extending the project with a set of challenges.
Try typecasting the return value from
dequeueReusableAnnotationView()
so that it's anMKPinAnnotationView
. Once that’s done, change thepinTintColor
property to your favorite UIColor.
- 🔗 Commit
Add a
UIAlertController
that lets users specify how they want to view the map. There's amapType
property that draws the maps in different ways. For example,.satellite
gives a satellite view of the terrain.
Modify the callout button so that pressing it shows a new view controller with a web view, taking users to the Wikipedia entry for that city.
- 🔗 Commit