大家好,请你告诉我当我在mapview上放置引脚时,我应该如何获得地名?这是我的代码
let geoCoder = CLGeocoder()
let location = CLLocation(latitude: touchedCoordination.latitude, longitude: touchedCoordination.longitude)
geoCoder.reverseGeocodeLocation(location) { (placemarks, error) in
var placeMark : CLPlacemark!
placeMark = placemarks![0]
print(placeMark.name)
print(placeMark.subAdministrativeArea)
print(placeMark.thoroughfare)
例如当我把麦克唐纳放在麦克唐纳上时,它会打印出来:
Optional("10990 N Stelling Rd")
Optional("Santa Clara")
Optional("N Stelling Rd")
但我想打印麦当劳的地名不是“10990 N Stelling Rd”
感谢您的帮助;)