Wrap up
Wrap up 관련
I tried to keep this project as simple as possible so that you can focus on the map component, because there was a lot to learn: MKMapView
, MKAnnotation
, MKPinAnnotationView
, CLLocationCoordinate2D
and so on, and all must be used before you get a finished product.
Again, we've only scratched the surface of what maps can do in iOS, but that just gives you more room to extend the app yourself!
Review what you learned
Anyone can sit through a tutorial, but it takes actual work to remember what was taught. It’s my job to make sure you take as much from these tutorials as possible, so I’ve prepared a short review to help you check your learning.
Challenge
One of the best ways to learn is to write your own code as often as possible, so here are three ways you should try your new knowledge to make sure you fully understand what’s going on:
- Try typecasting the return value from
dequeueReusableAnnotationView()
so that it's anMKPinAnnotationView
. Once that’s done, change thepinTintColor
property to your favoriteUIColor
. - 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.