进行反地理编码时,用户具体位置无法显示到View上

在尝试用户位置进行反地理编码的时候,无法显示到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

尝试的问题图片:

clipboard.png

clipboard.png

阅读 1.6k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题