Comment obtenir la Localisation de l'utilisateur avec CLLocationManager dans swift?

J'ai ce code sur mon point de vue, contrôleur, mais cela ne fonctionne pas:

 import UIKit
 import CoreLocation
 class ViewController: UIViewController, CLLocationManagerDelegate {

  var location: CLLocationManager!

 override func viewDidLoad() {
    super.viewDidLoad()

    location=CLLocationManager()
    location.delegate = self
    location.desiredAccuracy=kCLLocationAccuracyBest
    location.startUpdatingLocation()
}

 func locationManager(location:CLLocationManager, didUpdateLocations locations:AnyObject[]) {
    println("locations = \(locations)")
    label1.text = "success"
}

J'ai les autorisations comment je l'ai lu dans d'autres post. mais je n'ai pas l'obtenir jamais, aucun println..

Merci!!

Cela fonctionne pour moi Ses un simple exemple, Voir: stackoverflow.com/a/35973586/3410437

OriginalL'auteur user3745888 | 2014-06-16