Latest 0.0.1
License MIT
Platforms ios 8.0, requires ARC

UXM Token Field



To run the example project, clone the repo, and run pod install from the Example directory first.


UXMTokenField is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "UXMTokenField"


UXMTokenField provides two protocols: UXMTokenFieldDelegate and UXMTokenFieldDataSource. The delegate is optional and will allow you to react to events inside of the text field. The data source on the other hand is required to provide necessary information for how the field functions.


This protocol notifies you when things happen in the token field that you might want to know about.

  • tokenField:didEnterText: is called when a user hits the return key on the input field.
  • tokenField:didDeleteTokenAtIndex: is called when a user deletes a token at a particular index.
  • tokenField:didChangeText: is called when a user changes the text in the input field.
  • tokenField:didChangeContentHeight: is called when the height of the field is modified.
  • tokenFieldDidBeginEditing: is called when the input field becomes first responder.


This protocol allows you to provide info about what you want to present in the token field.

  • tokenField:titleForTokenAtIndex: to specify what the title for the token at a particular index should be.
  • tokenField:autocompleteValuesFor text: allows you to tell the token field what autocomplete values to display at any given time.
  • numberOfTokensInTokenField: to specify how many tokens you have.
  • tokenFieldCollapsedText: to specify what you want the token field to say in the collapsed state.

Additionally the token field has a number of other properties you can modify to customize it to your liking.

/// Public
var delegate:UXMTokenFieldDelegate
var dataSource:UXMTokenFieldDataSource

var maxHeight:CGFloat
var verticalInset:CGFloat
var horizontalInset:CGFloat
var tokenPadding:CGFloat
var minInputWidth:CGFloat

var inputTextFieldKeyboardType:UIKeyboardType
var inputTextFieldKeyboardAppearance:UIKeyboardAppearance

var autocorrectionType:UITextAutocorrectionType
var autocapitalizationType:UITextAutocapitalizationType
var inputTextFieldAccessoryView:UIView

var delimiters:[String]
var tokens:[UXMToken]
var tokenSeperator:String
var placeholderText:String
var placeholderAttributedText:NSAttributedString
var colorScheme:UIColor
var hideKeyboardOnAutocomplete:Bool


  • If the autocomplete table is not appearing, this could be because the parent elements clip to bound settings are preventing it from being seen.
  • Autocomplete cells allow for either an array of strings, or an array of UXMAutocompleteItem‘s to be passed in. While a string will display as just one line of text, an autocomplete item allows for a subtitle as well.


Chris Anderson:


UXMTokenField is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "UXMTokenField",
    "version": "0.0.1",
    "summary": "An easy-to-use token field with autocompletion",
    "description": "Incorporate a token field for emails, user look up, etc easily without having to recreate autocompletion.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Chris Anderson": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.0.1"
    "platforms": {
        "ios": "8.0"
    "requires_arc": true,
    "source_files": "UXMTokenField/Classes/**/*",
    "resource_bundles": {
        "UXMTokenField": [

Pin It on Pinterest

Share This