corelocation
Installation
SKILL.md
Core Location
Determining the user's location, geofencing, beacons, and visits on Apple platforms. The deep API reference — setup, authorization, the live-updates stream, CLMonitor, geocoding, beacons, visits, background, battery tuning, pitfalls, a full @Observable manager — lives in references/guide.md. This file is the decision and discipline layer: read it first, open the guide for specifics.
Dials
Set these explicitly at the start; they change what "correct" means.
AUTH_SCOPE—when-in-use(default; foreground only) ·always(background presence, geofences, visits — only request after when-in-use is already granted and you can justify it; App Review scrutinizes this) ·one-shot(LocationButton/ a singlerequestLocation, no persisted grant).UPDATE_MODE—one-shot(singlerequestLocation) ·live(default for continuous; iOS 17+CLLocationUpdate.liveUpdates()) ·significant-change(battery-cheap background presence) ·visits(place arrival/departure, needsalways).MONITORING—none·geofence(iOS 17+CLMonitor+CircularGeographicCondition) ·beacon(CLMonitor+BeaconIdentityCondition).
When to use
Building or reviewing any code that reads the user's position, monitors regions/beacons, tracks visits, or requests location permission. For drawing maps, annotations, or directions use MapKit (a later skill) — Core Location only supplies the coordinates and authorization.