thermogl / TITokenField

An iOS version of the NSTokenField (See To: field in Mail and Messages).
http://thermoglobalnuclearwar.com/opensource/
599 stars 172 forks source link

Prevent TITokenField from tokenizing unknown recipients. #49

Closed rex-remind101 closed 11 years ago

rex-remind101 commented 11 years ago

Added a bool .forcePickSearchResult to TITokenFieldView so the that user is forced to pick a search result when typing into the field. Like on Facebook message app. If making a messaging app this setting will prevent the user from sending to unknown recipients.

rex-remind101 commented 11 years ago

Found a bug in this, will fix and resubmit, sorry.

thermogl commented 11 years ago

Why not use the delegate method -tokenField:willAddToken:? You can return NO to prevent the user adding a token.

rex-remind101 commented 11 years ago

Setting a bool for all the functionality is simpler :)

Also, then there are two comparisons being performed, one against delimiters for when tokenizing happens and one for when you check to make sure it's a token you want.