I need to access the contacts of my iPhone into my app.
I am using Xcode 7.2 and IOS-9. Give me best framework or library which is usefully for me.
I try to work on the ABAddressbook framework but it has been deprecated.
Thank You.
I need to access the contacts of my iPhone into my app.
I am using Xcode 7.2 and IOS-9. Give me best framework or library which is usefully for me.
I try to work on the ABAddressbook framework but it has been deprecated.
Thank You.
Apple has introduced new frameworks Contacts and ContactsUI for accessing contacts for iOS9 and above.
The previous ABAddressbook framework has been deprecated. You might find a lot of info in SO on this.
You can make use of ContactsUI framework for iOS9+ devices
- (void) presentContacts
{
CNContactPickerViewController *contactPicker = [[CNContactPickerViewController alloc] init];
contactPicker.delegate = self;
[_myViewController presentViewController:contactPicker animated:YES completion:nil];
}
//Listen for delegates
- (void) contactPickerDidCancel: (CNContactPickerViewController *) picker
{
NSLog(@"didCancel");
}
- (void) contactPicker: (CNContactPickerViewController *) picker
didSelectContact: (CNContact *) contact
{
NSLog(@"didSelectContact"):
}
- (void) contactPicker: (CNContactPickerViewController *) picker
didSelectContactProperty: (CNContactProperty *) contactProperty
{
NSLog(@"didSelectProperty");
}
MFMessageComposeViewController https://developer.apple.com/library/ios/documentation/MessageUI/Reference/MFMessageComposeViewController_class/
tutorials http://www.appcoda.com/ios-programming-import-contact-address-book/
http://gabriel-tips.blogspot.in/2012/02/how-to-import-contacts-from-address.html