- (IBAction)onClickBtnPicker:(id)sender {
SYContactsPickerController *vcContacts = [[SYContactsPickerController alloc] init];
vcContacts.delegate = self;
[self presentViewController:vcContacts animated:YES completion:nil];
//
// if ([SYContactsHelper canAccessContacts]) {
// SYContactsPickerController *vcContacts = [[SYContactsPickerController alloc] init];
// [self presentViewController:vcContacts animated:YES completion:nil];
// }
// else {
// NSLog(@"can not access contact");
// }
}
#pragma mark - SYContactsPickerControllerDelegate
- (void)contactsPickerController:(SYContactsPickerController *)picker didFinishPickingContacts:(NSArray *)contacts {
NSLog(@"contacts==%@",contacts);
}
- (void)contactsPickerController:(SYContactsPickerController *)picker didSelectContacter:(SYContacter *)contacter {
NSLog(@"contacter==%@",contacter);
}
- (void)contactsPickerController:(SYContactsPickerController *)picker didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"indexPath==%@",indexPath);
}
- (void)contactsPickerControllerDidCancel:(SYContactsPickerController *)picker {
NSLog(@"contactsPickerControllerDidCancel");
}
SYContactsPicker/
目录复制到您的项目Foundation
、UIKit
、AddressBook
或 Contacts
SYContactsPickerController *vcContacts = [[SYContactsPickerController alloc] init]
vcContacts.delegate = self
[self presentViewController:vcContacts animated:YES completion:nil]
contactsPickerController:didFinishPickingContacts
contactsPickerController:didSelectContacter
contactsPickerController:didSelectRowAtIndexPath
contactsPickerControllerDidCancel
代码在 MIT 许可证的条款和条件下分发。
注意!如果您修复了您发现的错误,请也添加单元测试,以便我知道如何在合并前准确地重现错误。