在尝试用户位置进行反地理编码的时候,无法显示到View上。
故事版中使用的总View为NavigationView.
var CLLocationText = self.CLLocationText.text
var location:CLLocation =
LocationManager.reverseGeocodeLocationWithCoordinates(location,onReverseGeocodingCompletionHandler: {(reverseGecodeInfo,placemark, error) -> Void in
let address = reverseGecodeInfo?.object(forKey: "formattedAddress") as!String
self.CLLocationText.text = address
这里后面不知道使用什么方法。
var location:CLLocation =
之前的关于CLLocation的相关代码:
var LocationManager:LocationManager!
let manager = CLLocationManager()//创建manager跟踪用户位置
func locationManager(_ manager:CLLocationManager,didUpdateLocations locations: [CLLocation]){
已经尝试找过一些链接,仍没有解决。
编写时参考的两个Youtube视频:
How To Get The User's Current Location In xCode 8 (Swift 3.0)
iOS Swift Tutorial: Location and Maps
相关链接:
swift ios 系统定位和反地理编码-简书
What is causing the error “cannot convert value of type 'CLLocation.Type' to expected argument type 'CLLocation'”-Starkoverflow
尝试的问题图片: