Skip to content

DanielKrofchick/FOTokenText

Repository files navigation

FOTokenText

A UITextView and UITextField that supports token buttons, like those found in Mail. The tokens can be tappend on like buttons, and deleted.

Initialize an FOTextView

let textView = FOTokenTextView(frame: CGRect.zero)
textView.tokenDelegate = self

and implement the required FOTokenTextViewProtocol method newToken:textView:text

func newToken(_ textView: FOTokenTextView, text: String) -> FOTokenView {
  let token = FOTokenView(type: .system)
  token.setTitle(text, for: .normal)
  token.titleLabel?.font = textView.font

  return token
}

Example

Example

Try the example project in the FOTokenText_Example target.

Installation

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

pod 'FOPopup', :git => 'https://github.com/DanielKrofchick/FOTokenText.git'

Author

Daniel Krofchick, [email protected]

License

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

About

Token UITextView and UITextField

Resources

License

Stars

Watchers

Forks

Packages

No packages published