An object that you use to format a contact's postal addresses.


class CNPostalAddressFormatter : Formatter


A CNPostalAddressFormatter object handles international formatting of postal addresses. It is recommended that you create an instance of this class when formatting many postal addresses, and use the instance methods; otherwise use the class methods.


Generating a Formatted Attributed String

let CNPostalAddressPropertyAttribute: String

An attribute that identifies the purpose of a range of characters in an attributed string.

let CNPostalAddressLocalizedPropertyNameAttribute: String

An attribute that identifies the localized property of postal address.

Generating a Formatted String

func string(from: CNPostalAddress) -> String

Returns a formatted postal address.

class func string(from: CNPostalAddress, style: CNPostalAddressFormatterStyle) -> String

Returns a postal address as a string and formatted for the specified style.

Specifying the Formatting Style

var style: CNPostalAddressFormatterStyle

The style to apply when formatting strings.

enum CNPostalAddressFormatterStyle

Constants for postal formatting styles.

Getting the Postal Attribute Keys


Inherits From

Conforms To

See Also


class CNContactFormatter

An object that you use to format contact information before displaying it to the user.

class CNContactVCardSerialization

An object you use to convert to and from a vCard representation of the user's contacts.

class CNContactsUserDefaults

An object that defines the default options to use when displaying contacts.