Hi,
I am trying to display a CNContactViewController as a presentation, since pushing it on a navigation controller doesn't work for me in a splitView iPad app. I use this code to create and present the view controller:
CNContactViewController *createContact = [CNContactViewController viewControllerForContact: matchedContact];
createContact.delegate = self;
createContact.allowsActions = NO;
CNContactStore *store = [[CNContactStore alloc] init];
createContact.contactStore = store;
UINavigationController *navigation = [[UINavigationController alloc] initWithRootViewController:createContact];
navigation.modalPresentationStyle = UIModalPresentationPageSheet;
self.contactViewController = createContact;
[self presentViewController: navigation animated:YES completion:nil];
This displays the CNContactViewController correctly, but it only has an "Edit" button in the bar button items. It doesn't show a "Cancel" or "Done" button that would allow the user to dismiss the presented view controller. I can try adding it a cancel button in the left bar button items inside the completion handler after it's presented, but if the user presses Edit and then completes the edits, the left bar button item disappears.
Can the [CNContactViewController viewControllerForContact:] be presented, or does it always have to be pushed? If it can, then why isn't it working right now?