SCITokenSearchField
is based on VENTokenField but has the look of the native UISearchBar.
The easiest way to get started is to use CocoaPods. Add the following line to your Podfile:
pod 'SCITokenSearchField', '~> 1.0'
SCITokenSearchField
provides two protocols: <SCITokenSearchFieldDelegate>
and <SCITokenSearchFieldDataSource>
.
This protocol notifies you when things happen in the tokenSearchField that you might want to know about.
tokenSearchField:didEnterText:
is called when a user hits the return key on the input field.tokenSearchField:didDeleteTokenAtIndex:
is called when a user deletes a token at a particular index.tokenSearchField:didChangeText:
is called when a user changes the text in the input field.tokenSearchFieldDidBeginEditing:
is called when the input field becomes first responder.
This protocol allows you to provide info about what you want to present in the tokenSearchField.
tokenSearchField:titleForTokenAtIndex:
to specify what the title for the token at a particular index should be.numberOfTokensInTokenSearchField:
to specify how many tokens you have.clearTokenSearchFieldData:
to clear the tokens and the searchfield content
Check out the sample project in this repo for sample usage.