Tutorial by Examples

Import the CoreLocation module in your classes that use CoreLocation functionality. //Swift import CoreLocation //Objective-C #import <CoreLocation/CoreLocation.h>
Check the app's authorization status with: //Swift let status: CLAuthorizationStatus = CLLocationManager.authorizationStatus() //Objective-C CLAuthorizationStatus status = [CLLocationManager authorizationStatus]; Test the status against the follow constants: //Swift switch status { case ...
To check for location services we need real device but for testing purpose we can also use simulator and add our own location by following below steps: add new GPX file into your project. in GPX file add waypoints like <?xml version="1.0"?> <gpx version="1.1" cre...
To use standard location services while the application is in the background you need first turn on Background Modes in the Capabilities tab of the Target settings, and select Location updates. Or, add it directly to the Info.plist. <key>NSLocationAlwaysUsageDescription</key> <st...

Page 1 of 1