I am trying to get the location of the user. To do this, I set the following property in info.plist:

I also added the following code to my viewDidLoad method, as well as the following function. The problem is that the function is locationManager(manager, didUpdate....)never called, I also never receive a request for permission to access the location, even if I uninstalled and installed the application again. I am testing this on my iPad and not on the simulator. The didFailWithError function is never called.
self.locationManager.delegate = self
self.locationManager.desiredAccuracy = kCLLocationAccuracyBest
self.locationManager.requestWhenInUseAuthorization()
self.locationManager.startUpdatingLocation()
func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
print("UPDATING")
let locValue:CLLocationCoordinate2D = manager.location!.coordinate
let latitude = locValue.latitude
let longitude = locValue.longitude
latitudeText = "\(latitude)"
longitudeText = "\(longitude)"
if let a = latitudeText, b = longitudeText {
print(a)
print(b)
self.locationManager.stopUpdatingLocation()
if (userAlreadyExist()) {
dispatch_async(dispatch_get_main_queue(), {
self.performSegueWithIdentifier("showCamera", sender: self)
})
}
else {
dispatch_async(dispatch_get_main_queue(), {
self.performSegueWithIdentifier("segueWhenLoggedOut", sender: self)
})
}
}
}
func locationManager(manager: CLLocationManager, didFailWithError error: NSError) {
print(error.localizedDescription)
}
EDIT:
I added the following code snippet:
if CLLocationManager.locationServicesEnabled() {
print("yes")
}
else {
print("no")
}
. , locationServices , , " ", "" "", , .