
Mapkit
Implement, review, or improve maps and location features in iOS/macOS apps using MapKit...
Install
npx skills add dpearson2699/swift-ios-skills --skill mapkit -g -a claude-code -y- Repository
- dpearson2699/swift-ios-skills1.3k
- Category
- Mobile
- Updated
- 3mo ago
- License
- See repository
- Context cost
- Mediumabout 3,000 tokens
- Runs scripts
- No, instructions only
What it does
Implement, review, or improve maps and location features in iOS/macOS apps using MapKit and CoreLocation. Use when working with Map views, annotations, markers, polylines, user location tracking, geocoding, reverse geocoding, search/autocomplete, directions and routes, geofencing, region monitoring, CLLocationUpdate async streams, or location authorization flows. Also use when working with maps, coordinates, addresses, places, directions, distance calculations, or location-based features in Swift apps.
MapKit
Build map-based and location-aware features targeting iOS 17+ with SwiftUI
MapKit and modern CoreLocation async APIs. Use Map with MapContentBuilder
for views, CLLocationUpdate.liveUpdates() for streaming location, and
CLMonitor for geofencing.
Read references/mapkit-patterns.md when you need full map setup, search, routes, Look Around, snapshots, or iOS 26 place APIs. Read references/mapkit-corelocation-patterns.md when the task involves location update lifecycle, geofencing, background location, testing, or privacy keys.
Contents
- Workflow
- SwiftUI Map View (iOS 17+)
- CoreLocation Modern API
- Geocoding
- Search
- Directions
- PlaceDescriptor (iOS 26+)
- Common Mistakes
- Review Checklist
- References
Workflow
1. Add a map with markers or annotations
- Import
MapKit. - Create a
Mapview with optionalMapCameraPositionbinding. - Add
Marker,Annotation,MapPolyline,MapPolygon, orMapCircleinside theMapContentBuilderclosure. - Configure map style with
.mapStyle(). - Add map controls with
.mapControls { }. - Handle selection with a
selection:binding.
2. Track user location
- Add
NSLocationWhenInUseUsageDescriptionto Info.plist. - On iOS 18+, create a
CLServiceSessionto manage authorization. - Iterate
CLLocationUpdate.liveUpdates()in aTask. - Filter updates by distance or accuracy before updating the UI.
- Stop the task when location tracking is no longer needed.
