Skip to content

An UITextField replacement to select multiple e-mails

License

Notifications You must be signed in to change notification settings

ppaulojr/PPJEmailPicker

Repository files navigation

PPJEmailPicker

Build Status CocoaPods Compatible GitHub issues GitHub license Twitter

An UITextField replacement to select multiple e-mails

Demo

maildemo2

Installation with CocoaPods

Podfile

Add the line below to your Podfile:

pod 'PPJEmailPicker'

Usage

Programatically

Step 1 - Import Header

#import "PPJEmailPicker.h"
Step 2 - create object
-(PPJEmailPicker *) createAutoCompleteFieldWithFrame:(CGRect)frame
{
	PPJEmailPicker * actf = [[PPJEmailPicker alloc] initWithFrame:frame];
	actf.pickerDelegate = self;
	actf.possibleStrings = [[ListOfEmails emails] mutableCopy];
	actf.placeholder = NSLocalizedString(@"Type e-mail to send recognition", nil);
	return actf;
}
Step 3 - Pass a list of emails to it
	actf.possibleStrings = @[@"[email protected]", @"[email protected]];

Interface Builder

Add a UITextField and change the class to PPJEmailPicker.

ibchange

Don't forget to set the pickerDelegate and to pass a list of e-mails for autocompletion.

Questions

Contact me at Twitter: @ppaulojr