I create new CNContactViewController
for add new contacts on phone directory but when I navigate to controller CNContactViewController
navigation back button is hidden. Following my code.
CNContactStore *store = [[CNContactStore alloc] init];
CNMutableContact *contact = [[CNMutableContact alloc] init];
contact.familyName = @"name_1";
contact.givenName = @"xyz";
CNLabeledValue *homePhone = [CNLabeledValue
labeledValueWithLabel:CNLabelHome value:[CNPhoneNumber
phoneNumberWithStringValue:@"0123456789"]];
contact.phoneNumbers = @[homePhone];
CNContactViewController *contactVC = [CNContactViewController
viewControllerForNewContact:contact];
contactVC.contactStore = store;
contactVC.delegate = (id)self;
[self.navigationController pushViewController:contactVC animated:TRUE];
Please suggest me best solution for showing back & Done button using Objective-C or Swift-3.
As suggested here, you can subclass
CNContactViewController
to add adone
button to thenavigationItem
.Something like this:
In order to make use of this class, make sure that
ContactDetailsViewController
is embedded inside aUINavigationController
.Although I'm so late to answer, but I hope this helps you or someone else.