Address Formatting With Street And Street Number As 2 Separate Fields

212 Views Asked by At

I get address fields from our backend. They separated street and street_number in two separate fields and I need to display it in the correct format depending on the set region of the iPhone.

In earlier versions of iOS this was possible by populating an address dictionary and pass it to ABCreateStringWithAddressDictionary(). This function is now deprecated. The replacement is the CNPostalAddress struct. But this struct has no streetNumber property anymore. The street number must thus be included in the street property. But I cannot simply concatenate street and number together since I don't know how to do this for each country.

  • Is it somehow possible to accomplish this with the Contacts framework?
  • Is it possible to still use the deprecated versions?
  • Is there any framework (Cocoapod) that is capable of this?
0

There are 0 best solutions below