转载

[iOS] WSTagsField:可定制、易用的标签文本框输入组件

WSTagsField

An iOS text field that represents different Tags.

[iOS] WSTagsField:可定制、易用的标签文本框输入组件

Usage

let tagsField = WSTagsField() tagsField.backgroundColor = .whiteColor() tagsField.padding = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) tagsField.spaceBetweenTags = 10.0 tagsField.font = UIFont.systemFontOfSize(12.0) tagsField.tintColor = .greenColor() tagsField.textColor = .blackColor() tagsField.fieldTextColor = .blueColor() tagsField.selectedColor = .blackColor() tagsField.selectedTextColor = .redColor() tagsField.delimiter = ","  // Events tagsField.onDidAddTag = { _ in     print("DidAddTag") }  tagsField.onDidRemoveTag = { _ in     print("DidRemoveTag") }  tagsField.onDidChangeText = { _, text in     print("DidChangeText") }  tagsField.onDidBeginEditing = { _ in     print("DidBeginEditing") }  tagsField.onDidEndEditing = { _ in     print("DidEndEditing") }  tagsField.onDidChangeHeightTo = { sender, height in     print("HeightTo /(height)") }

Installation

[iOS] WSTagsField:可定制、易用的标签文本框输入组件 Carthage

To install it, simply add the following line to your Cartfile :

github "whitesmith/WSTagsField"

Then run carthage update .

Follow the current instructions inCarthage's README for up to date installation instructions.

CocoaPods

To install it, simply add the following line to your Podfile :

pod "WSTagsField"

You will also need to make sure you're opting into using frameworks:

use_frameworks!

Then run pod install with CocoaPods 1.0 or newer.

Manually

Download all the source files and drop them into your project.

Requirements

  • iOS 8.0+
  • Xcode 7 (Swift 2.2)

Contributing

The best way to contribute is by submitting a pull request. We'll do our best to respond to your patch as soon as possible. You can also submit anew GitHub issue if you find bugs or have questions. [iOS] WSTagsField:可定制、易用的标签文本框输入组件

Credits

[iOS] WSTagsField:可定制、易用的标签文本框输入组件

This project was heavily inspired byCLTokenInputView.

原文  https://github.com/whitesmith/WSTagsField
正文到此结束
Loading...