Giter Club home page Giter Club logo

jladdressbook's Introduction

JLAddressBook

Version Platform

Requirements

iOS 7.0

Installation

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

pod "JLAddressBook"

Usage

To run the example project; clone the repo, run pod install, then open JLAddressBookExample.xcworkspace.

All you need to do is create an entity type that conforms to this protocol

@protocol JLContact<NSObject>

@optional

@property(nonatomic, strong) NSString *firstName;
@property(nonatomic, strong) NSString *lastName;
@property(nonatomic, strong) NSArray *phoneNumbers;    // NSString's
@property(nonatomic, strong) NSArray *emails;          // NSString's
@property(nonatomic, strong) NSArray *addressBookIDs;  // NSNumbers's
@property(nonatomic, strong) UIImage *thumbnail;
@property(nonatomic, strong) UIImage *photo;

@end

and then use the JLCoreDataContactManager or define a contact manager to keep track of these entities yourself:

@protocol JLContactManager<NSObject>

@required

- (id<JLContact>)newContact;
- (NSArray *)existingContacts;

@end

then you call JLAddressBook syncContacts to update your contacts from the iphone address book

@interface JLAddressBook : NSObject

- (instancetype)initWithContactManager:(id<JLContactManager>)contactManager;

+ (BOOL)authorized;
+ (void)attemptToAuthorize:(AuthorizationBlock)block;

- (NSArray *)syncContacts;

- (UIImage *)photoForContact:(id<JLContact>)contact;
- (UIImage *)thumbnailForContact:(id<JLContact>)contact;

- (void)addContactToDevice:(id<JLContact>)contact;
- (void)addContactToDevice:(id<JLContact>)contact withPhoto:(UIImage *)photo;

@end

Author

Projects

Here is a list of iPhone apps utilizing this library:

Faysee - Faysee Homepage

License

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

jladdressbook's People

Contributors

jlaws avatar

Stargazers

creantan avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.