我只需要客户最近位置的城市信息而不是地区。知道如何避免吗?
pm.locality
返回:Budapest VII. kerület
,我只希望Budapest
。
func locationManager(manager: CLLocationManager!, didUpdateLocations locations: [AnyObject]!) {
CLGeocoder().reverseGeocodeLocation(locations.first as CLLocation, completionHandler: {placemarks, error in
let pm = placemarks.first as CLPlacemark