TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Jul 2015 |
Maintained by Sebastian Gomez Osorio.
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!
#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 = "[email protected]";
},
{
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":@"[email protected]"}]
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.