Swift – Use GPS during a flight with .airborne

Starting from iOS 12, Apple introduces a new CLActivityType in the Core Location framework.

It is a new way to track the GPS position when you’re flighting!

import CoreLocation 

let manager = CLLocationManager() 
manager.activityType = .airborne 

Activity Types

case other : The location manager is being used for an unknown activity.

case automotiveNavigation : The location manager is being used specifically during vehicular navigation to track location changes to the automobile.

case fitness : The location manager is being used to track fitness activities such as walking, running, cycling, and so on.

case otherNavigation : The location manager is being used to track movements for other types of vehicular navigation that are not automobile related.

case airborne : The location manager is being used specifically during airborne activities.


Enjoy tracking!

Alberto Pasca