Latest 0.1.2
Homepage https://github.com/crespoxiao/CPContact
License MIT
Platforms ios 8.0
Frameworks UIKit, Foundation, AddressBook, Contacts
Authors

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

iOS8+

Installation

CPContact is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "CPContact"

Guide

The following code is just for test. Take it easy.😄

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]);
                        }];
                    }];
                }];
            }];
        }];
    }];
}];

TODO

ABAddressBook is deprecated on iOS9, so i will use CNContact instead.

Author

CrespoXiao http://weibo.com/crespoxiao

License

CPContact is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "CPContact",
    "version": "0.1.2",
    "summary": "CPContact is an iOS lib to operate address book.",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "https://github.com/crespoxiao/CPContact",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "xiaochengfei": "[email protected]"
    },
    "source": {
        "git": "https://github.com/crespoxiao/CPContact.git",
        "tag": "0.1.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "CPContact/Classes/**/*",
    "frameworks": [
        "UIKit",
        "Foundation",
        "AddressBook",
        "Contacts"
    ]
}

Pin It on Pinterest

Share This