iOS 文本标签工具 WSTagsField

码农软件 · 软件分类 · 标签(Label) · 2019-06-08 16:58:14

软件介绍

WSTagsField 是采用swift开发的,用于给文字添加标签样式。

效果图:

WSTagsField

使用环境:

  • iOS 8.0+

  • Xcode 7 (Swift 2.2)

示例代码:

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)")
}

本文地址:https://www.codercto.com/soft/d/7536.html

Hacking Growth

Hacking Growth

Sean Ellis、Morgan Brown / Crown Business / 2017-4-25 / USD 29.00

The definitive playbook by the pioneers of Growth Hacking, one of the hottest business methodologies in Silicon Valley and beyond. It seems hard to believe today, but there was a time when Airbnb w......一起来看看 《Hacking Growth》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具