andreamazz / AMTagListView

UIScrollView subclass that allows to add a list of highly customizable tags.
MIT License
758 stars 110 forks source link

exposed ui elements #44

Closed superarts closed 8 years ago

superarts commented 8 years ago

I know you probably wouldn't agree, but in my case I found it's pretty frustrated that I couldn't change the text of a single tag without reloading the whole thing. For example, my tags are displayed as "TagIsCool +31", and I would like to allow the user to tap it to increase the count. To do this, I can use tag.labelTextalong with tag.button to implement my logic.

Comparing with some design pattern and principle, I'd like to get things done really quick.

andreamazz commented 8 years ago

Hi @superarts I see your point, but exposing those elements can cause issues, e.g. when you set a text that is longer than before. In this case the text might be rendered outside of the tag.
That's why I can't merge this PR. On the other hand I can probably add a setText method that re-renders the single tag and rearranges if needed.
What do you think?

superarts commented 8 years ago

Yea I totally agree man. That would be great!

andreamazz commented 8 years ago

:+1: Ok, I'll work on it in the next few days.

andreamazz commented 8 years ago

Hi @superarts Checkout commit e083e02 You'll find setTagText: in the AMTagView. I also updated the sample to have the behaviour you described above (tapping the tag add a +1). I'll cover all with test and push a new version soon.

superarts commented 8 years ago

Thanks!

On Sun, Oct 25, 2015 at 12:42 AM, Andrea Mazzini notifications@github.com wrote:

Hi @superarts https://github.com/superarts Checkout commit e083e02 https://github.com/andreamazz/AMTagListView/commit/e083e02c923edb383b33ab3b3f69e907c599660d You'll find setTagText: in the AMTagView. I also updated the sample to have the behaviour you described above (tapping the tag add a +1). I'll cover all with test and push a new version soon.

— Reply to this email directly or view it on GitHub https://github.com/andreamazz/AMTagListView/pull/44#issuecomment-150813008 .

Regards,

Leo