I have been using ABPeople
Picker to show Contacts and then import the selected contact into my app.
Need to migrate to CNContact
as AB
has become unreliable.
I have found some examples but they're all in Swift. Specifically, need ObjectiveC help with CNContactPickerViewController
.
Current code looks like this:
-(void)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker didSelectPerson:(ABRecordRef)person
{
CFTypeRef generalCFObject = ABRecordCopyValue(person, kABPersonFirstNameProperty);
if (generalCFObject) {
self.first = (__bridge_transfer NSString*)ABRecordCopyValue(person,kABPersonFirstNameProperty);
NSLog (@"First Name %@",first);
}
}