WSTagsField
WSTagsField copied to clipboard
How to add delete button next to the already added tag?
How can I add a delete button next to the tag? And pressing that button the particular tag should be deleted?
you need to modify the code, use this:
textField.onDeleteBackwards = { [weak self] in
if self?.readOnly ?? true {
return
}
/*
// Original
if self?.isTextFieldEmpty ?? true, let tagView = self?.tagViews.last {
self?.selectTagView(tagView, animated: true)
self?.textField.resignFirstResponder()
}
*/
if let tagView = self?.tagViews.last {
self?.removeTag(tagView.displayText)
}
I know, maybe is too late for you, (I'm not the author), just played with this repo a little.