VDContactPicker 2.0.2

VDContactPicker 2.0.2

Maintained by Vishal Deep.



  • By
  • Vishal Deep

VDContactPicker

VDContactPicker

A contacts picker component using Apple's Contacts framework.

Platform Swift 4.1 CocoaPods Compatible Carthage compatible CI Status License Twitter: @VishalDeep

This library was originally forked from JFContactsPicker

Preview

Single SelectionMulti Selection

Installation

CocoaPods

VDContactPicker is available on CocoaPods. Just add the following to your project Podfile:

pod 'VDContactPicker', '~> 1.0'

Manual Installation

Just drag and drop the Source folder into your project

Requirements

  • iOS9+
  • Swift 4.1
  • ARC

For manual installation you may need to add these frameworks in your Build Phases: ContactsUI.framework and Contacts.framework.

Features

VDContactPicker provides all common functionality and customization features:

[x] Single selection and multi-selection options. [x] Search Contacts [x] Configure the contact data to be shown. (Phone Number, Email, Birthday, or Organization) [x] Section indexes to easily navigate through the contacts. [x] Shows initials when image is not available. [x] Contact object to get the properties of the contacts

If you would like additional support for additional customization features, please Create a New Issue.

Initialization

Initialize the picker by passing the delegate, multiselection option, and the secondary data type to be displayed (Phone Number, Email, Birthday, or Organization).

let contactPicker = VDContactPicker(delegate: self, multiSelection:false, subtitleCellType: .email)
let navigationController = UINavigationController(rootViewController: contactPicker)
self.present(navigationController, animated: true, completion: nil)

Delegates

VDContactPicker provides you four delegate methods for responding to the picker's events.

func contactPicker(_ contactPicker: VDContactsPicker, didContactFetchFailed error : NSError)
func contactPicker(_ contactPicker: VDContactsPicker, didCancel error : NSError)
func contactPicker(_ contactPicker: VDContactsPicker, didSelectContact contact : VDContact)
func contactPicker(_ contactPicker: VDContactsPicker, didSelectMultipleContacts contacts : [VDContact])

Contact Object

The VDContact object provides you the properties of a contact. This contains properties like displayName, initials, firstName, lastName, company, birthday, etc.

License

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

Contributors

@vdeep

Original Authors @JettF
@AnthonyMDev
@ipraba
@Sorix