---
title: CNPostalAddressFormatter
framework: contacts
role: symbol
role_heading: Class
path: contacts/cnpostaladdressformatter
---

# CNPostalAddressFormatter

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

## Declaration

```swift
class CNPostalAddressFormatter
```

## Overview

Overview 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.

## Topics

### Generating a formatted attributed string

- [attributedString(from:withDefaultAttributes:)](contacts/cnpostaladdressformatter/attributedstring(from:withdefaultattributes:).md)
- [attributedString(from:style:withDefaultAttributes:)](contacts/cnpostaladdressformatter/attributedstring(from:style:withdefaultattributes:).md)
- [CNPostalAddressPropertyAttribute](contacts/cnpostaladdresspropertyattribute.md)
- [CNPostalAddressLocalizedPropertyNameAttribute](contacts/cnpostaladdresslocalizedpropertynameattribute.md)

### Generating a formatted string

- [string(from:)](contacts/cnpostaladdressformatter/string(from:).md)
- [string(from:style:)](contacts/cnpostaladdressformatter/string(from:style:).md)

### Specifying the formatting style

- [style](contacts/cnpostaladdressformatter/style.md)
- [CNPostalAddressFormatterStyle](contacts/cnpostaladdressformatterstyle.md)

### Getting the postal attribute keys

- [CNPostalAddressCityKey](contacts/cnpostaladdresscitykey.md)
- [CNPostalAddressCountryKey](contacts/cnpostaladdresscountrykey.md)
- [CNPostalAddressISOCountryCodeKey](contacts/cnpostaladdressisocountrycodekey.md)
- [CNPostalAddressPostalCodeKey](contacts/cnpostaladdresspostalcodekey.md)
- [CNPostalAddressStateKey](contacts/cnpostaladdressstatekey.md)
- [CNPostalAddressStreetKey](contacts/cnpostaladdressstreetkey.md)
- [CNPostalAddressSubAdministrativeAreaKey](contacts/cnpostaladdresssubadministrativeareakey.md)
- [CNPostalAddressSubLocalityKey](contacts/cnpostaladdresssublocalitykey.md)

## Relationships

### Inherits From

- [Formatter](foundation/formatter.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Formatters

- [CNContactFormatter](contacts/cncontactformatter.md)
- [CNContactVCardSerialization](contacts/cncontactvcardserialization.md)
- [CNContactsUserDefaults](contacts/cncontactsuserdefaults.md)
