andreamazz / AMTagListView

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

Height before creating the view #59

Closed PaulRBerg closed 8 years ago

PaulRBerg commented 8 years ago

3 This issue's solution tells that you can get the content size after you've created the tag list view, but I have a situation where I need it before. Can you please write a method which calculates that? I tried to look into your files, but there are a couple of interesting lines over there.

andreamazz commented 8 years ago

Hi @razvan-paul You need the content size before what? Before adding the tags?

andreamazz commented 8 years ago

I provide a delegate method for a single tag:

- (BOOL)tagList:(AMTagListView *)tagListView shouldAddTagWithText:(NSString *)text resultingContentSize:(CGSize)size;

I guess this could be expanded to multiple tags. That will eventually return the content size before adding the tags. Would that do?

andreamazz commented 8 years ago

Added in 996f0f5 a new delegate:

- (BOOL)tagList:(AMTagListView *)tagListView shouldAddTagsWithText:(NSArray *)tags resultingContentSize:(CGSize)size;

Let me know if that works for you.

PaulRBerg commented 8 years ago

Perfect, just what I wanted. Thank you!

andreamazz commented 8 years ago

👍 Released 1.2.0