<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Contacts",
  "identifier" : "/documentation/Contacts/CNContactFormatter",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Contacts"
    ],
    "preciseIdentifier" : "c:objc(cs)CNContactFormatter"
  },
  "title" : "CNContactFormatter"
}
-->

# CNContactFormatter

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

```
class CNContactFormatter
```

## Overview

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.

## Topics

### Creating a formatted attributed string

[`-  attributedStringFromContact:defaultAttributes:`](/documentation/Contacts/CNContactFormatter/attributedString(from:defaultAttributes:))

Formats the contact name as an attributed string.

[`+  attributedStringFromContact:style:defaultAttributes:`](/documentation/Contacts/CNContactFormatter/attributedString(from:style:defaultAttributes:))

Formats the contact name as an attributed string.

### Creating a formatted string

[`-  stringFromContact:`](/documentation/Contacts/CNContactFormatter/string(from:))

Formats the contact name.

[`+  stringFromContact:style:`](/documentation/Contacts/CNContactFormatter/string(from:style:))

Returns the contact name, formatted with the specified formatter.

### Specifying the formatting style

[`style`](/documentation/Contacts/CNContactFormatter/style)

The formatting style for the contact name.

[`CNContactFormatterStyle`](/documentation/Contacts/CNContactFormatterStyle)

The formatting styles for contact names.

### Getting a descriptor

[`+  descriptorForRequiredKeysForStyle:`](/documentation/Contacts/CNContactFormatter/descriptorForRequiredKeys(for:))

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

[`descriptorForRequiredKeysForDelimiter`](/documentation/Contacts/CNContactFormatter/descriptorForRequiredKeysForDelimiter)

Returns the required key descriptor for the name delimiter.

[`descriptorForRequiredKeysForNameOrder`](/documentation/Contacts/CNContactFormatter/descriptorForRequiredKeysForNameOrder)

Returns the required key descriptor for the display name order.

### Getting format information

[`+  delimiterForContact:`](/documentation/Contacts/CNContactFormatter/delimiter(for:))

Returns the delimiter to use between name components.

[`+  nameOrderForContact:`](/documentation/Contacts/CNContactFormatter/nameOrder(for:))

Returns the display name order.

[`CNContactDisplayNameOrder`](/documentation/Contacts/CNContactDisplayNameOrder)

The formatting orders for contact names component.

## Relationships

### Inherits From

[`Formatter`](/documentation/Foundation/Formatter)

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Equatable`](/documentation/Swift/Equatable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)