如何引用及权限的配置:http://blog.youkuaiyun.com/sbt0198/article/details/52728922
在配置完成的前提下,获取当前的位置以及逆编码信息:
import UIKit
class ViewController: UIViewController {
var locationManager:AMapLocationManager!
override func viewDidLoad() {
super.viewDidLoad()
self.locationManager = AMapLocationManager()
self.locationManager.requestLocationWithReGeocode(true) {
(location,regeocode,error) -> Void in
print("\(regeocode)")
}
self.locationManager.locationTimeout = 6
self.locationManager.reGeocodeTimeout = 3
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}