The Apple documentation suggests using CNPostalAddressFormatter
to display addresses as a formatted string, which helps immensely with internationalization.
This code:
let postalString = CNPostalAddressFormatter.string(from: postalAddress.value, style: .mailingAddress)
yields this work address for the John Appleseed
contact on the simulator:
3494 Kuhl Avenue
Atlanta GA 30303
The address is missing the comma between city and state.
Is there a way for CNPostalAddressFormatter to insert the comma? The documentation doesn't list anything.
If not, doesn't this mean you must manually format addresses for each locality, and are unable to use CNPostalAddressFormatter
for localization?