Git Product home page Git Product logo

thcontactpicker's Introduction

THContactPicker

THContactPicker is an iOS view used for selecting contacts. It is built to mimic the contact selecting functionality in the iOS Mail app. It also supports customization for different styling requirements.

Screenshot Screenshot

##Installation THContactPicker can be added to your project manually or using Cocoapods:

pod 'THContactPicker', '~> 0.0'

##Usage The view can be added using interface builder or programmatically. Here is an example of adding it programmatically:

self.contactPickerView = [[THContactPickerView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 100)];
[self.contactPickerView setPlaceholderLabelText:@"Who would you like to message?"];
self.contactPickerView.delegate = self;
[self.view addSubview:self.contactPickerView];

Adding and removing contacts from the view is done with these two functions:

- (void)addContact:(id)contact withName:(NSString *)name;
- (void)removeContact:(id)contact;

THContactPickerView defines the following delegate protocol to make it easy for you views to respond to any changes:

- (void)contactPickerTextViewDidChange:(NSString *)textViewText;
- (void)contactPickerDidRemoveContact:(id)contact;
- (void)contactPickerDidResize:(THContactPickerView *)contactPickerView;
- (BOOL)contactPickerTextFieldShouldReturn:(UITextField *)textField;

##Customization:

Set the text that is displayed in the view when there are no selected contacts:

- (void)setPlaceholderLabelText:(NSString *)text;

Set the text for the Preceding prompt label. If not set, the label will not be displayed:

- (void)setPromptLabelText:(NSString *)text;	

Change the font of all elements in the view:

- (void)setFont:(UIFont *)font;

Set the style of the contacts item for default and selected states:

- (void)setContactViewStyle:(THContactViewStyle *)color selectedStyle:(THContactViewStyle *)selectedColor;

THContactViewStyle defines the look of each contact item. The following attributes can be modified: text label color, top gradient color, bottom gradient color, border color, border width and corner radius factor. Sample contact view style with iOS 6 look:

Screenshot

thcontactpicker's People

Contributors

tristanhimmelman avatar vkovtash avatar kenleezle avatar dvor avatar schayes04 avatar dickbrouwer avatar rad182 avatar

Watchers

Song Wang 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.