Как получить доступ к почтовому коду с помощью MKMapItem?IOS

Программируем под IOS
Anonymous
Как получить доступ к почтовому коду с помощью MKMapItem?

Сообщение Anonymous »

Похоже, в последних выпусках Apple удалила MKPlacemark, который содержал почтовый код, адрес и т. д. Итак, теперь в iOS 26 я могу получить доступ к почтовому индексу?
struct Place {

let latitude: Double
let longitude: Double
let shortAddress: String
let fullAddress: String

var zone: String?

init(from mapItem: MKMapItem) {
self.latitude = mapItem.location.coordinate.latitude
self.longitude = mapItem.location.coordinate.longitude
self.shortAddress = mapItem.addressRepresentations?.cityWithContext(.short) ?? ""
self.fullAddress = mapItem.addressRepresentations?.cityWithContext(.full) ?? ""

}
}


Подробнее здесь: https://stackoverflow.com/questions/798 ... -mkmapitem

Вернуться в «IOS»