TLTagsControl icon indicating copy to clipboard operation
TLTagsControl copied to clipboard

Cannot remove tags programmatically. Decide to add tag or not after pressing return key.

Open therohansanap opened this issue 10 years ago • 5 comments

So I have this situation where duplicate tags are not allowed. So I was trying to check if the tag is already present in tags array and then decide If I want to add tag or not. But I cannot control what happens on pressing return. So I thought I, let the tag get added. I will check for the duplicate after that, and if present, I will programmatically remove it but there is no provision for that too. If possible, can you please address this issue? At least support for removing tags programmatically.

therohansanap avatar Dec 03 '15 10:12 therohansanap

Hi @therohansanap

In fact you can remove a tag programmatically. TLTagsControl has *tags property which is kind of NSMutableArray class. This means that you can remove any object from this array using removeObject: method. If you modify *tags property programmatically you should reload TLTagsControl by using reloadTagSubviews method.

Hope that helps.

AntonKuznetsov avatar Dec 03 '15 10:12 AntonKuznetsov

Got it! Thank you! @AntonKuznetsov

therohansanap avatar Dec 03 '15 11:12 therohansanap

I also noticed that condition for duplicate tags is handled in addTags: method. Well done!

therohansanap avatar Dec 04 '15 05:12 therohansanap

作者大人 TLTagsControl 这个框架真机实测 连续打几个字的拼音 会自动enter 求帮忙解决qq1031974317

zhanglizhong1002 avatar Jun 22 '16 10:06 zhanglizhong1002

@AntonKuznetsov The adults TLTagsControl this framework of prototype measurement for Pinyin words will automatically enter seeking help to solve the qq1031974317

zhanglizhong1002 avatar Jun 22 '16 10:06 zhanglizhong1002