How to get address in English language only using GMSGeocoder

天涯浪子 提交于 2020-06-28 03:43:02

问题


I am using GMSGeocoder in my iOS app. And also I am using multiple languages(say English, Arabic). While using Arabic language I am getting an address in Arabic language. But I want to get the address in English language only.

For this I used geocoder.accessibilityLanguage = "en-US". but it didn't work. Could you help me regarding this issue

func getAddressForLocation() {
    let geocoder = GMSGeocoder()
    geocoder.accessibilityLanguage = "en-US"
    let coordinate = CLLocationCoordinate2DMake(Double(self.PickupLat),Double(self.PickupLong))
    geocoder.reverseGeocodeCoordinate(coordinate) { response , error in
        if let address = response?.firstResult() {
            print(address)
        }
    }
}

来源:https://stackoverflow.com/questions/48656656/how-to-get-address-in-english-language-only-using-gmsgeocoder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!