My app that worked fine on iOS 7 doesn\'t work with the iOS 8 SDK.
CLLocationManager
doesn\'t return a location, and I don\'t see my app under
One common error for Swift developers:
First make sure you add a value to the plist for either NSLocationWhenInUseUsageDescription
or NSLocationAlwaysUsageDescription
.
If you are still not seeing a window pop up asking for authorization, look to see if you are putting the line var locationManager = CLLocationManager()
in your View Controller's viewDidLoad
method. If you do, then even if you call locationManager.requestWhenInUseAuthorization()
, nothing will show up. This is because after viewDidLoad executes, the locationManager variable is deallocated (cleared out).
The solution is to locate the line var locationManager = CLLocationManager()
at the top of the class method.