17.2 · Core Location and MapKit
Location is the most privacy-sensitive and most battery-sensitive API most apps use. The craft is asking for the least precision, for the shortest time, with the weakest permission that does the job.
Mental model. Ask for the least accuracy and the least permission that works, and let the system wake you for what matters instead of polling.
Finding the user
Authorization, accuracy, significant changes, visits and geofences.
- How does Core Location work: authorization levels, accuracy, significant-change and visits, and geofencing?
A CLLocationManager delivers locations to its delegate. Authorization has levels: When In Use (only while the app is visible or running a foreground-started…
Showing places
MapKit annotations, regions and clustering.
- How do you show places with MapKit: annotations, overlays, regions and clustering?
MapKit shows a map and the things on it. In SwiftUI use Map with Marker, Annotation, MapPolyline and MapCircle content builders and a MapCameraPosition…
More in System frameworks
- 17.1 · UserNotifications, APNs and how a push actually gets delivered
- 17.3 · Contacts, Calendar, Photos, HealthKit and Core Motion
- 17.4 · CloudKit, StoreKit 2 and PassKit
- 17.5 · AuthenticationServices and passkeys, Spotlight, Handoff and user activities
- 17.6 · Live Activities, WeatherKit, App Clips and CarPlay
- 17.7 · A checklist for learning any Apple framework
- 17.8 · APNs tokens, payload budgets and notification triggers
- 17.9 · Cleaning location fixes, choosing geofences, and map geometry
- 17.10 · Contacts, EventKit, HealthKit units and sensor availability
- 17.11 · Records, system fields and CKError handling
- 17.12 · Passkey assertions, Apple ID tokens and Live Activity payloads