Recall & Review
beginner
What is MapKit in iOS development?
MapKit is a framework by Apple that lets you add maps and location features to your iOS apps. It helps show maps, add pins, and get directions.
Click to reveal answer
beginner
How do you add a map view to your iOS app using MapKit?
You add an MKMapView to your view controller, either in Interface Builder or by code, then set its frame and add it to the view hierarchy.
Click to reveal answer
intermediate
What is an MKAnnotation in MapKit?
MKAnnotation is a protocol for objects that represent points on the map, like pins. You create annotations to mark locations on the map.
Click to reveal answer
intermediate
How can you center the map on a specific location?
You create an MKCoordinateRegion with a center coordinate and span, then set it on the MKMapView using setRegion(_:animated:).
Click to reveal answer
intermediate
What is the role of CLLocationManager when using MapKit?
CLLocationManager helps get the user's current location and updates. It works with MapKit to show where the user is on the map.
Click to reveal answer
Which class is used to display a map in an iOS app?
✗ Incorrect
MKMapView is the class that displays the map interface.
What protocol must an object conform to in order to be a map pin?
✗ Incorrect
MKAnnotation protocol defines the properties needed for a map pin.
How do you update the map to show a new region?
✗ Incorrect
setRegion(_:animated:) changes the visible area of the map.
Which class provides the user's current location?
✗ Incorrect
CLLocationManager handles location updates from the device.
What do you need to add in your app to request user permission for location?
✗ Incorrect
You must add a usage description key in Info.plist to ask for location permission.
Explain how to add a map with a pin showing a location in an iOS app using MapKit.
Think about the map view, the pin object, and how to show the pin on the map.
You got /4 concepts.
Describe the steps to get and show the user's current location on a map.
Remember you need permission and a way to update the map with the user's position.
You got /4 concepts.