TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Oct 2016 |
Maintained by Chengfei Xiao.
To run the example project, clone the repo, and run pod install
from the Example directory first.
iOS8+
CPContact is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "CPContact"
CFXABContactModel *model = [[CFXABContactModel alloc]init];
model.basicModel = [[CFXABBasicInfoModel alloc]init];
model.basicModel.firstName = @"xiao";
model.basicModel.lastName = @"crespo";
model.basicModel.title = @"ceo";
CFXABPhoneModel *phone = [[CFXABPhoneModel alloc]init];
phone.number = @"1111";
phone.type = @"office";
model.phoneArray = @[phone];
[CFXContact addReocrdWithModel:model success:^(BOOL success) {
NSLog(@"test1: %d",success);
[CFXContact addPhoneNumber:@"2222" toExistFullName:@"xiao crespo" success:^(BOOL success) {
NSLog(@"test2: %d",success);
[CFXContact loadContacts:^(NSArray *array) {
NSLog(@"test3: %lu",(unsigned long)[array count]);
[CFXContact removedRecordWithFullName:@"xiao crespo" success:^(BOOL success) {
NSLog(@"test4: %d",success);
[CFXContact loadContacts:^(NSArray *array) {
NSLog(@"test5: %lu",(unsigned long)[array count]);
[CFXContact delAllRecord:^(BOOL success) {
NSLog(@"test6: %d",success);
[CFXContact loadContacts:^(NSArray *array) {
NSLog(@"test7: %lu",(unsigned long)[array count]);
}];
}];
}];
}];
}];
}];
}];
ABAddressBook is deprecated on iOS9, so i will use CNContact instead.
CrespoXiao http://weibo.com/crespoxiao
CPCache is available under the MIT license. See the LICENSE file for more info.