ContactsManager is a delightful library for iOS. It's built with high quality standards to optimize the performance of your application and get your contacts quickly and safely.
Choose ContactsManager for your next project, or migrate over your existing projects, we guarantee you'll be happy you did!
- Download ContactsManager and try out the included iPhone Demo
- Using CocoaPods
- Copying all the files into your project
ContactsManager is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'ContactsManager'
After this import ContactsManager:
#import "KTSContactsManager.h"
- Drag and Drop ContactsManager folder into your project
- In "Choose options dialog" check "Copy items if needed" and select "Create Groups" option, then press finish Button.
- In the Class that you want get the device contacts, import ContactsManager:
#import "KTSContactsManager.h
self.contactsManager = [KTSContactsManager sharedManager];
[self.contactsManager importContacts:^(NSArray *contacts) {
NSLog(@"contacts: %@",contacts);
}];
We return a JSON representation from contacts
{
birthday = "1978-01-20 12:00:00 +0000";
company = "Creative Consulting";
createdAt = "2008-02-14 01:33:02 +0000";
department = "";
emails = (
{
label = Work;
value = "kate-bell@mac.com";
},
{
label = Work;
value = "www.icloud.com";
}
);
firstName = "";
firstNamePhonetic = "";
id = 1;
jobTitle = Producer;
lastName = Bell;
lastNamePhonetic = "";
middleName = "";
nickName = "";
note = "";
phones = (
{
label = Mobile;
value = "(555) 564-8583";
}
);
prefix = "";
suffix = "";
updatedAt = "2015-04-25 23:27:46 +0000";
}
self.contactsManager.sortDescriptors = @[ [NSSortDescriptor sortDescriptorWithKey:@"firstName" ascending:YES] ];
Implement KTSContactsManagerDelegate in your controller and create delegate function to filter contacts.
self.contactsManager.delegate = self;
-(BOOL)filterToContact:(NSDictionary *)contact
{
return ![contact[@"company"] isEqualToString:@""];
}
Add method from delegate and listen when any contact change.
self.contactsManager.delegate = self;
-(void)addressBookDidChange
{
NSLog(@"Address Book Change");
}
[self.contactsManager addContactName: @"Tefany"
lastName: @"Jhonson"
phones: @[@{@"label":@"mobile",@"value":@"731782982"}]
emails: @[@{@"label":@"work",@"value":@"tefany@work.com"}]
birthday: nil completion:^(BOOL wasAdded) {
NSLog(@"%i",wasAdded);
}];
[self.contactsManager removeContactById:184 completion:^(BOOL wasRemoved) {
NSLog(@"%i",wasRemoved);
}];
Kekiiwaa Inc, Sebastian Gomez Osorio, Andres Silva Gomez
ContactsManager is available under the MIT license. See the LICENSE file for more info.