didChangeAuthorizationStatus no se llamó después de hacer clic en Permitir

Este es mi código para implementar google map y CLLocationManager :

 class MapViewController: UIViewController { @IBOutlet weak var MapView: GMSMapView! var locationmanager = CLLocationManager() override func viewDidLoad() { super.viewDidLoad() locationmanager.delegate = self locationmanager.requestWhenInUseAuthorization() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } } extension MapViewController: CLLocationManagerDelegate { private func locationManager(manager: CLLocationManager, didChangeAuthorizationStatus status: CLAuthorizationStatus) { print("didChangeAuthorizationStatus") if status == .authorizedWhenInUse { locationmanager.startUpdatingLocation() MapView.isMyLocationEnabled = true MapView.settings.myLocationButton = true } } func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { print("didUpdateLocations") if let location = locations.first { MapView.camera = GMSCameraPosition(target: location.coordinate, zoom: 15, bearing: 0, viewingAngle: 0) locationmanager.stopUpdatingLocation() } } } 

después de hacer clic en Permitir o no Permitir didChangeAuthorizationStatus nunca invocado

Si está en Swift 3, la firma completa de este método no es correcta.

Esto es lo que necesitas:

 func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) { //your code }