I'm currently working on a Swift app and I want the user to be able to edit a contact that they created earlier in the app. That being said, I'm using the CNContactViewController(forContact: CNContact)
init function to create the view controller.
I have the following code in a subclass of TableViewController
which is embedded in a Navigation controller
let contactViewController = CNContactViewController(forNewContact: contact)
contactViewController.delegate = self
self.navigationController?.pushViewController(contactViewController, animated: true)
When the contactViewController
comes into view, the contact loads fine but the edit button is missing from the Navigation bar on top. If I hard code print(contactViewController.allowsEdits)
immediately before pushing it to the Nav controller, it says true, which is weird.
Thanks for the help.
(Note, the contact I pass into the constructor is a CNMutableContact
, so it should be editable)