Day 61
Day 61 ๊ด๋ จ
Project 16, part two
I could easily have written this whole course about UIKit, skipping out Core Image, SpriteKit, MapKit, and more. But my hope is that by immersing you in other Apple frameworks youโre starting to become soaked in their way of approaching things โ youโre starting to build a build a gut instinct for how Appleโs framework work.
I realize this place extra learning stress on you, because rather than staying within our comfort weโre constantly pushing forward into new things. It will help you in the long term, though โ as James Bryant Conant said, โbehold the turtle โ it makes progress only when it sticks its neck out.โ
Today youโve finished another app, and I hope feel like you have a basic grasp of how maps work. Thereโs a lot more you can do with them, such as adding placemarks, looking up locations, and finding directions, but I hope you can at least see that itโs all within your grasp now!
Today you should work through the wrap up chapter for project 16, complete its review, then work through all three of its challenges.
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.
Click here to review what you learned in project 16.
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.
Wrap up - Additional
Thatโs another project finished, and one that gets you started with one of the most popular and powerful iOS frameworks โ make sure you share your progress with others once you complete the challenges!