iOS CapabilitiesLesson 69Free preview
MapKit
This lesson is part of Swift · All levels
Summary
This lesson reviews the integration of interactive maps into apps using MapKit and SwiftUI. Massively updated in iOS 17 with the declarative control 'Map()', developers can display street maps, add custom location markers (Markers & Annotations), set camera regions (MapCameraPosition), and calculate routes for navigation.
Key points
- The 'Map()' component in SwiftUI presents a full interactive Apple Maps map
- 'Marker' and 'Annotation' insert a marker of an interesting location on the map
- 'MapCameraPosition' controls the camera position, zoom rate, and rotation of the map's viewing angle
- Class 'MKDirections' calculates the route of car travel, footpaths, and estimated time of arrival (ETA)
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.