点击某些按钮后,按钮的标题应显示为带有' X'的标签或文字。标记,点击' X'文本应从搜索栏中消失。
答案 0 :(得分:0)
Hoefull这会对你有帮助。
let tagsField = WSTagsField()
tagsField.backgroundColor = .white
tagsField.padding = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
tagsField.spaceBetweenTags = 10.0
tagsField.font = .systemFont(ofSize: 12.0)
tagsField.tintColor = .green
tagsField.textColor = .black
tagsField.fieldTextColor = .blue
tagsField.selectedColor = .black
tagsField.selectedTextColor = .red
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://github.com/whitesmith/WSTagsField/blob/master/README.md