<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ContactsUI",
  "identifier" : "/documentation/ContactsUI/CNContactViewControllerDelegate/contactViewController(_:didCompleteWith:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Contacts UI"
    ],
    "preciseIdentifier" : "c:objc(pl)CNContactViewControllerDelegate(im)contactViewController:didCompleteWithContact:"
  },
  "title" : "contactViewController(_:didCompleteWith:)"
}
-->

# contactViewController(_:didCompleteWith:)

Called when the view has been presented.

```
optional func contactViewController(_ viewController: CNContactViewController, didCompleteWith contact: CNContact?)
```

## Parameters

`viewController`

The view controller presenting the contact.

`contact`

The newly, or existing contact being added.

## Discussion

If creating a new contact, the new contact added to the contacts list is passed in
`contact`. If adding to an existing contact, the existing contact is passed in `contact`.
It is up to the delegate to dismiss the view controller.

---

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)