Como obter o usuário Location com CLLocationManager rapidamente?
Eu tenho esse código no meu controlador de exibição, mas isso não está funcionando:
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"
}
Eu tenho as permissões como eu leio em outro post. mas eu não obtenho nunca, não imprime ..
Obrigado!!