我试图将 CLLocationCoordinates2d 坐标转换为物理街道地址。
我试过 CLGeocoder 没有运气。这是我提供纬度和经度坐标的代码。
let manager = CLLocationManager()
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation])
{
guard let locValue: CLLocationCoordinate2D = manager.location?.coordinate else { return }
print("locations = \(locValue.latitude) \(locValue.longitude)")
// let locationtext = "locations = \(locValue.latitude) \(locValue.longitude)"
locationTxt.text = "\(locValue.latitude) \(locValue.longitude)"
}
Run Code Online (Sandbox Code Playgroud)
谢谢!