Apple's framework for obtaining geographic location and orientation of a device. Core Location provides services to determine device location, heading, and proximity to iBeacons.
of iOS users worldwide can use Core Location (iOS 2+ required)
| iOS Version | Market Share | Status |
|---|---|---|
| iOS 18.7 | 30.3% | Supported |
| iOS 18.6 | 29.8% | Supported |
| iOS 26.1 | 10.7% | Supported |
| iOS 18.5 | 6.0% | Supported |
| iOS 16.7 | 2.3% | Supported |
| iOS 26.2 | 2.0% | Supported |
| iOS 18.3 | 1.8% | Supported |
| iOS 15.8 | 1.8% | Supported |
| iOS 11.0 | 1.7% | Supported |
| iOS 17.6 | 1.7% | Supported |
GPS and network-based location
Continuous location updates
Geofencing and region monitoring
Heading and compass data
iBeacon proximity detection
Significant location change monitoring
Request user permission to access location
import CoreLocation
class LocationManager: NSObject, CLLocationManagerDelegate {
let manager = CLLocationManager()
override init() {
super.init()
manager.delegate = self
}
func requestPermission() {
manager.requestWhenInUseAuthorization()
}
func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) {
switch manager.authorizationStatus {
case .authorizedWhenInUse, .authorizedAlways:
manager.startUpdatingLocation()
case .denied, .restricted:
print("Location access denied")
default:
break
}
}
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
guard let location = locations.last else { return }
print("Lat: \(location.coordinate.latitude), Lon: \(location.coordinate.longitude)")
}
}Apple's framework for obtaining geographic location and orientation of a device. Core Location provides services to determine device location, heading, and proximity to iBeacons.
Core Location is available on iOS 2 and later. Currently, 99.8% of iOS users worldwide can use this framework.
Related frameworks include Mapkit. Each has different capabilities and iOS version requirements.