3

I'm using this to show contact detail and it has option to edit contact:

let toFetch = [CNContactViewController.descriptorForRequiredKeys()]
let cnContact = try contactStore!.unifiedContact(withIdentifier: contanctIdentifier, keysToFetch: toFetch)

let contactsViewController = CNContactViewController(for: cnContact)
contactsViewController.delegate = self
contactsViewController.allowsEditing = true

But I want to show edit screen without showing contact detail.

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Hamza Ansari
  • 3,009
  • 1
  • 23
  • 25

1 Answers1

0

just change CNContactViewController(for: cnContact) to

let cvc = CNContactViewController(forNewContact: contact) it will work

let contactsViewController = CNContactViewController(forNewContact: cnContact)
contactsViewController.delegate = self
contactsViewController.allowsEditing = true