venmo / VENTokenField

Easy-to-use token field that is used in the Venmo app.
MIT License
794 stars 195 forks source link

Flexibility to choose color for individual texts in VENTokenField #57

Closed MaheshRS closed 9 years ago

MaheshRS commented 9 years ago

This change allows us to choose different colour for different token title.

This change is because, I am using VENTokenField to input email-ID's. If the email ID's were invalid, I needed to show it in red.

MaheshRS commented 9 years ago

@ayanonagon Can you please take a look at the PR.

ayanonagon commented 9 years ago

Hi, thank you for the pull-request. I think individualized colors for tokens is a cool idea, but I think we can improve the API a bit here!

How about instead of:

- (UIColor *)colorSchemeForText:(NSString *)text inTokenField:(VENTokenField *)field;

have

- (UIColor *)tokenField:(VENTokenField *)tokenField colorSchemeForTokenAtIndex:(NSUInteger)index;

since I can foresee cases where you’d want to have different colors for a token even if they have the same title.

Thanks again for the pull-request. :octocat:

MaheshRS commented 9 years ago

@ayanonagon Yep! Have made the necessary changes :smile:

ayanonagon commented 9 years ago

Thanks for the PR and edits @MaheshRS!