With ABAddressBook, when I wanted the user to be able to "Create a new contact" and "Add to an existing contact" for a contact that they had not seen before, I would create and introduce ABUnknownPersonViewController .
I cannot find a way to replicate this functionality within CNContacts. It seemed to me that CNContactViewController(forUnknownContact: contact) could work, but, unfortunately, this allows the user to "Send a message" or "Share a contact."
How can I allow a user to save a contact in my address book, either as a new contact, or as part of an existing one, in CNContacts?
func presentContact() { let status = CNContactStore.authorizationStatusForEntityType(.Contacts) switch status { case .Authorized: () case .NotDetermined: requestAccess() case .Denied, .Restricted: accessDenied() } print("authorized? \(status == .Authorized)") //prints "authorized? true" let unknown = CNContactViewController(forUnknownContact: contact!) unknown.delegate = self self.navigationController?.pushViewController(unknown, animated: false) }
Even when I try to request access, the user still cannot save the contact.
source share