Unlike iOS 7 where it automatically asks the user for permission to use location data, In iOS 8 we need to call a specific method before calling the startUpdatingLocation.
Which method to call depends upon whether you want to use location service only in foreground, i.e. while the app is running, or in the background as well, i.e. which is app is in background.
//Put the required method name inside the @selector.
//Replace the methods below with your required method name.
Note: You need to put this code before startUpdatingLocation method call.
Now we need to do one final thing, which is a requirement. We need to add a key to the Info.plist file. Depending on the method we are using above, the two keys are – NSLocationAlwaysUsageDescription and NSLocationWhenInUseUsageDescription.
These are string keys, where you will put the description or the message, which will appear while the system asks the user for location permission.
Location services should once again work fine now.