lundi 25 juillet 2016

CLPlacemark to string in iOS 9

I want to format CLPlacemark to string.

The well known way is to use ABCreateStringWithAddressDictionary but it was deprecated in iOS 9. Warning tells me to use CNPostalAddressFormatter instead.

However, CNPostalAddressFormatter can only format CNPostalAddress. There is no way to properly convert CLPlacemark to CNPostalAddress; only these 3 properties are shared by CLPlacemark and CNPostalAddress: country, ISOcountryCode, and postalCode.

So how should I format CLPlacemark to string now?

Aucun commentaire:

Enregistrer un commentaire