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

# CNContactViewController

A view controller that displays a new, unknown, or existing contact.

```
class CNContactViewController
```

## Overview

Present a `CNContactViewController` object when you want to display
information about one of the user’s contacts. At creation time, you specify the type
of contact you want to display: new, unknown, or existing.

## Topics

### Creating the Contact Viewer

[`+  viewControllerForContact:`](/documentation/ContactsUI/CNContactViewController/init(for:))

Initializes a view controller for an existing contact.

[`init(forContact:)`](/documentation/ContactsUI/CNContactViewController/init(forContact:))

Initializes a view controller for an existing contact.

[`+  viewControllerForUnknownContact:`](/documentation/ContactsUI/CNContactViewController/init(forUnknownContact:))

Initializes a view controller for an unknown contact.

[`+  viewControllerForNewContact:`](/documentation/ContactsUI/CNContactViewController/init(forNewContact:))

Initializes a view controller for a new contact.

### Handling Interactions with the Interface

[`delegate`](/documentation/ContactsUI/CNContactViewController/delegate)

The delegate to be notified.

[`CNContactViewControllerDelegate`](/documentation/ContactsUI/CNContactViewControllerDelegate)

Methods you use to respond to user interactions with a contact view controller.

### Required Keys

[`+  descriptorForRequiredKeys`](/documentation/ContactsUI/CNContactViewController/descriptorForRequiredKeys())

Returns the descriptor for all the keys that must be fetched on the contact before
setting it on the view controller.

### Displaying Contact Properties

[`contact`](/documentation/ContactsUI/CNContactViewController/contact)

The contact being displayed.

[`alternateName`](/documentation/ContactsUI/CNContactViewController/alternateName)

The name to use if the contact has no display name.

[`message`](/documentation/ContactsUI/CNContactViewController/message)

The message displayed under the name of the contact.

[`displayedPropertyKeys`](/documentation/ContactsUI/CNContactViewController/displayedPropertyKeys)

The contact property keys to display.

### Configuring the Contact’s Relationships

[`parentGroup`](/documentation/ContactsUI/CNContactViewController/parentGroup)

The group in which to add a new contact.

[`parentContainer`](/documentation/ContactsUI/CNContactViewController/parentContainer)

The container in which to add a new contact.

### Contact Store

[`contactStore`](/documentation/ContactsUI/CNContactViewController/contactStore)

The contact store from which the contact was fetched or to which it will be saved.

### Customizing Contact Card

[`allowsEditing`](/documentation/ContactsUI/CNContactViewController/allowsEditing)

Determines whether the user can edit the contact’s information.

[`allowsActions`](/documentation/ContactsUI/CNContactViewController/allowsActions)

Determines whether to display buttons for actions such as sending a text message
or initiating a FaceTime call.

[`shouldShowLinkedContacts`](/documentation/ContactsUI/CNContactViewController/shouldShowLinkedContacts)

Determines whether to display data from contacts that are linked to the contact being
displayed.

### Highlighting a Property

[`-  highlightPropertyWithKey:identifier:`](/documentation/ContactsUI/CNContactViewController/highlightProperty(withKey:identifier:))

Highlights the property of the contact being displayed.

## Relationships

### Conforms To

[`NSStandardKeyBindingResponding`](/documentation/AppKit/NSStandardKeyBindingResponding)

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

[`UITraitEnvironment`](/documentation/UIKit/UITraitEnvironment)

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

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

[`NSSeguePerforming`](/documentation/AppKit/NSSeguePerforming)

[`NSTouchBarProvider`](/documentation/AppKit/NSTouchBarProvider)

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

[`UIPasteConfigurationSupporting`](/documentation/UIKit/UIPasteConfigurationSupporting)

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

[`UIUserActivityRestoring`](/documentation/UIKit/UIUserActivityRestoring)

[`UIStateRestoring`](/documentation/UIKit/UIStateRestoring)

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

[`UIActivityItemsConfigurationProviding`](/documentation/UIKit/UIActivityItemsConfigurationProviding)

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

[`NSEditor`](/documentation/AppKit/NSEditor)

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

[`UIFocusEnvironment`](/documentation/UIKit/UIFocusEnvironment)

[`UIAppearanceContainer`](/documentation/UIKit/UIAppearanceContainer)

[`UITraitChangeObservable-67e94`](/documentation/UIKit/UITraitChangeObservable-67e94)

[`NSUserActivityRestoring`](/documentation/AppKit/NSUserActivityRestoring)

[`UIContentContainer`](/documentation/UIKit/UIContentContainer)

[`UIResponderStandardEditActions`](/documentation/UIKit/UIResponderStandardEditActions)

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

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

[`NSUserInterfaceItemIdentification`](/documentation/AppKit/NSUserInterfaceItemIdentification)

### Inherits From

[`UIViewController`](/documentation/UIKit/UIViewController)

[`NSViewController`](/documentation/AppKit/NSViewController)

---

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)