Step 1: Add following key and value in Info. plist of your project.
1. Key – NSLocationWhenInUseUsageDescription
Value- This will be used to obtain or track your location.
2. Key -NSLocationAlwaysUseUsageDescription
value- This will be used to obtain or track your location.
Step 2 : add following line where you want to declare or initialise core location .
if ([locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) {
[locationManager requestAlwaysAuthorization]; [locationManager requestWhenInUseAuthorization];}