阅读背景:

如何从CLLocationManager传递经度和纬度以使用全局swift

来源:互联网 
func locationManager(manager: CLLocationManager!, didUpdateLocations locations: [AnyObject]!) {
        var locValue:CLLocationCoordinate2D = manager.location.coordinate
        println("locations = \(locValue.latitude) \(locValue.longitude)")


    CLGeocoder().reverseGeocodeLocation(manager.location, completionHandler: {(placemarks, error)->Void in

        if (error != nil) {
            println("Error: " + error.localizedDescription)
            return
        }

        if placemarks.count > 0 {
            let pm = placemarks[0] as CLPlacemark
            self.locationManager.stopUpdatingLocation()
            //self.dismissViewControllerAnimated(true, completion: nil)
            self.displayLocationInfo(pm)


        } else {
            println("Error with the data.")
        }


    })

}
func locationManager(manager: CLLocationManager



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: