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


class CNContactFormatter : Formatter


A CNContactFormatter object handles international ordering and delimiting for the contact name components. When formatting many contacts, create an instance of this class and use the instance methods; otherwise use the class methods.


Creating a Formatted String

class func string(from: CNContact, style: CNContactFormatterStyle) -> String?

Returns the contact name, formatted with the specified formatter.

Specifying the Formatting Style

var style: CNContactFormatterStyle

The formatting style for the contact name.

enum CNContactFormatterStyle

The formatting styles for contact names.

Getting a Descriptor

class func descriptorForRequiredKeys(for: CNContactFormatterStyle) -> CNKeyDescriptor

Returns the required key descriptor for the specified formatting style of the contact.

Getting Format Information

class func delimiter(for: CNContact) -> String

Returns the delimiter to use between name components.

enum CNContactDisplayNameOrder

The formatting orders for contact names component.


Inherits From

See Also


class CNPostalAddressFormatter

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

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.