Swift requestWhenInUseAuthorization not working
<p>I'm writing an app for iOS 9.3 using swift and need a map to show user location.
I initialize <em>CLLocationManager</em> and its delegate, I configure info.plist 
<em>Privacy - Location Usage Description</em> string and invoke <em>requestWhenInUseAuthorization</em> but it does not show any authorization request.</p>

<p>Here is my code:</p>

<pre><code>import UIKit
import MapKit

class DetailController: UIViewController, CLLocationManagerDelegate {

    var locManager: CLLocationManager!

    @IBOutlet var myMap: MKMapView!

    override func viewDidLoad() {
        super.viewDidLoad()

        mostraPosizione()
    }

    func mostraPosizione(){
        locManager = CLLocationManager()
        locManager.delegate = self
        locManager.desiredAccuracy = kCLLocationAccuracyBest

        let authorizationStatus = CLLocationManager.authorizationStatus()

        if (authorizationStatus == CLAuthorizationStatus.NotDetermined) {
            locManager.requestWhenInUseAuthorization()
        } else {
            locManager.startUpdatingLocation()
        }


        myMap.showsUserLocation = true
    }

    func locManager(manager: CLLocationManager, 
    didChangeAuthorizationStatus status: CLAuthorizationStatus) {

        if (status == CLAuthorizationStatus.NotDetermined) {
            locManager.requestWhenInUseAuthorization()

        } else {
            locManager.startUpdatingLocation()
        }
    }
}
</code></pre>

<p>and a screenshot from my info.plist
<a href="https://i.stack.imgur.com/VZr2J.png" rel="noreferrer"><img src="https://i.stack.imgur.com/VZr2J.png" alt="info.plist"></a></p>

<p>Xcode output:</p>

<blockquote>
  <p>Trying to start MapKit location updates without prompting for location authorization. 
  Must call -[CLLocationManager requestWhenInUseAuthorization] 
  or -[CLLocationManager requestAlwaysAuthorization] first.</p>
</blockquote>

<p>I'm testing it on iPhone 5 s (iOS 9.3) simulator.</p>

<p><strong>What's the problem with this stuff?</strong>
Does anyone have any advice?</p>