I have CoreLocation in my Swift app. When I run this in simulator or in a device, this crash and not show the permissions to access CoreLocation.. I have all code necessary to implement this: request in code, NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription in plist... I'm reading iOS app doesn't ask for location permission but I can't make that this show.
var location: CLLocationManager!
let status = CLLocationManager.authorizationStatus()
location=CLLocationManager()
if(status == CLAuthorizationStatus.NotDetermined) {
self.location.requestAlwaysAuthorization();
}
else {
location.startUpdatingLocation()
}
location.delegate = self
location.desiredAccuracy=kCLLocationAccuracyBest
self.location.startMonitoringSignificantLocationChanges()
print(location.location.coordinate.latitude) //Here crash
print(location.location.coordinate.longitude)
What other things can I make for show this?
Thanks!