Latest 0.0.2
Homepage https://github.com/CodeAtlas/VeeContactPicker
License MIT
Platforms ios 7.0, requires ARC
Dependencies UIImageView-AGCInitials, FLKAutoLayout
Authors

VeeContactPicker

CI Status
Version
License
Platform

VeeContactPicker Example

VeeContactPicker is an Objective-C replacement for the ABPeoplePickerNavigationController. It lets you choose a contact from the address book.

Features

  • Load contacts very fast! Not like the iOS official controller (see this SO question)
  • Contacts’ images and coloured placeholders with contacts’ initials!
  • Search contacts also by email addresses or phone numbers!
  • Retro compatible with iOS 7
  • Handle contacts selection with completion block or delegation
  • Choose which contacts you want to show in the picker (e.g only contacts with a valid email address)
  • Easy customizable appearance, without needing to subclass it
  • Good test coverage

How to use it – Basic

Import the ViewController:

#import "VeeContactPickerViewController.h"

Initialize it and set the delegate:

VeeContactPickerViewController* veeContactPickerViewController = [[VeeContactPickerViewController alloc] initWithDefaultConfiguration];
veeContactPickerViewController.contactPickerDelegate = self;
[self presentViewController:veeContactPickerViewController animated:YES completion:nil];

And then implement the VeeContactPickerDelegate

- (void)didSelectContact:(id<VeeContactProt>)veeContact
{
    //Do whatever you want with the selected veeContact!
}

-(void)didCancelContactSelection
{
  //No contact was selected
}

-(void)didFailToAccessAddressBook
{
  //Show an error?
}

That’s all folks!

How to use it – Details

You can customize some properties of the picker by changing the object VeeContactPickerOptions and pass it to the initializer:

- (instancetype)initWithOptions:(VeeContactPickerOptions*)veeContactPickerOptions;

For example, if you don’t like the contacts’ initials images as the placeholder, you can set your own placeholder:

VeeContactPickerOptions* veeContactPickerOptions = [VeeContactPickerOptions alloc] initWithDefaultOptions];
veeContactPickerOptions.showInitialsPlaceholder = NO;
veeContactPickerOptions.contactThumbnailImagePlaceholder = [UIImage imageNamed:@"your_placeholder"];
//...
VeeContactPickerViewController* veeContactPickerViewController = [[VeeContactPickerViewController alloc] initWithOptions:veeContactPickerOptions];
//...

Contact’s image placeholder are provided by AGCInitials. You can customize the color palette if you want, see the README of AGCInitials.

  • If you want to change or localize the strings shown by the picker, look at this property:
veeContactPickerOptions.veeContactPickerStrings

  • If you want to choose which contacts to show, you can initialize the picker using:
- (instancetype)initWithVeeContacts:(NSArray<id<VeeContactProt>>*)veeContacts;

Picker Appearance:

You can customize most of the appearance properties of the picker by setting them in the singleton class VeeContactPickerAppearanceConstants, before loading the picker.

For example:

[[VeeContactPickerAppearanceConstants sharedInstance] setNavigationBarTintColor:[UIColor purpleColor]];
[[VeeContactPickerAppearanceConstants sharedInstance] setNavigationBarTranslucent:NO];
[[VeeContactPickerAppearanceConstants sharedInstance] setContactCellPrimaryLabelFont:[UIFont yourFont]];
//...
[self presentViewController:veeContactPickerViewController animated:YES completion:nil];

Run the example

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

Or you can even try the example online with Appetize.

Requirements

  • iOS 7+
  • At the moment the project is only for iPhone

Installation

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

pod "VeeContactPicker"

Author

Andrea Cipriani [email protected] – Code Atlas SRL – [email protected]

License

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

App Store

VeeContactPicker is already used in the App Store for our app Veer Contacts Widget; if you have appreciated our work, you can download the app for free! 😏

Latest podspec

{
    "name": "VeeContactPicker",
    "version": "0.0.2",
    "summary": "A replacement for the iOS ABPeoplePickerNavigationController, with contacts' images",
    "description": "VeeContactPicker is an objc replacement for the (bugged) ABPeoplePickerNavigationController. It's a ViewController that allows you to choose a contact from the address book.",
    "homepage": "https://github.com/CodeAtlas/VeeContactPicker",
    "screenshots": "https://raw.githubusercontent.com/CodeAtlas/VeeContactPicker/master/Screenshots/VeeContactPickerScreen1.png",
    "license": "MIT",
    "authors": {
        "Code Atlas SRL": "[email protected]"
    },
    "source": {
        "git": "https://github.com/CodeAtlas/VeeContactPicker.git",
        "tag": "0.0.2"
    },
    "social_media_url": "https://github.com/CodeAtlas",
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "VeeContactPicker": [
            "Pod/Assets/*.{xib}"
        ]
    },
    "dependencies": {
        "UIImageView-AGCInitials": [],
        "FLKAutoLayout": []
    }
}

Pin It on Pinterest

Share This