在我的iOS应用中,我想让用户在GMSMapView
上用长按手势选择一个地址。所以我实现了mapView:_ didLongPressAtCoordinate:_
方法来获取他选择的坐标并进行reverseGeocoding并得到地址:
let geocoder = GMSGeocoder()
geocoder.reverseGeocodeCoordinate(coordinate) { response, error in
if let address = response?.firstResult() {
// Everything ok
} else {
// Here the response is 'nil'
}
}
如果响应为nil
以获取与人类可读地址最近的位置坐标,我可以在此处执行哪些操作?