TokenField

@IBDesignable
open class TokenField : UIView, UITextFieldDelegate, BackspaceTextFieldDelegate

A text field that groups input texts with delimiters.

  • The receiver’s delegate.

    Declaration

    Swift

    public weak var delegate: TokenFieldDelegate?
  • Characters that completes a new token, defaults are whitespace and commas.

    Declaration

    Swift

    public var delimiters: [String]
  • Texts of each created token.

    Declaration

    Swift

    public var texts: [String] { get }
  • The image on the left of text field.

    Declaration

    Swift

    @IBInspectable
    public var icon: UIImage? { get set }
  • The text field that handles text inputs. Do not change textField’s delegate, which is required to be handled by TokenField.

    Declaration

    Swift

    public var textField: UITextField { get }
  • The placeholder with the default color and font.

    Declaration

    Swift

    @IBInspectable
    public var placeholder: String? { get set }
  • The placeholder with customized attributes.

    Declaration

    Swift

    public var attributedPlaceholder: NSAttributedString? { get set }
  • Customized attributes for tokens in the normal state, e.g. .font and .foregroundColor.

    Declaration

    Swift

    public var normalTokenAttributes: [NSAttributedStringKey : NSObject]? { get set }
  • Customized attributes for tokens in the highlighted state.

    Declaration

    Swift

    public var highlightedTokenAttributes: [NSAttributedStringKey : NSObject]? { get set }
  • The tint color of icon image and text field.

    Declaration

    Swift

    open override var tintColor: UIColor! { get set }
  • Initializes and returns a newly allocated view object with the specified frame rectangle.

    Declaration

    Swift

    public override init(frame: CGRect)
  • Returns an object initialized from data in a given unarchiver.

    Declaration

    Swift

    public required init?(coder aDecoder: NSCoder)