apploft / ExpandableLabel

A simple UILabel subclass that shows a tappable link if the content doesn't fit the specified number of lines
MIT License
464 stars 126 forks source link

Delegate #41

Open Ariavm95 opened 7 years ago

Ariavm95 commented 7 years ago

I know the demo is working, but in my code, when I write mCell.expandablelabel.delegate=self, and add delegate functions at the end, it seems it doesn't fire the delegate function when I tap on "read more". I tested it by print("test") in the methods. PS: I converted my app from Swift 3.2 to 4 to work with this pod. My app worked with Swift 3 version of this pod before.

Ariavm95 commented 7 years ago

I found the solution (or the problem itself). You can't use different fonts while using this pod. It just doesn't work.

Akaqlonist commented 7 years ago

I have met same issue - delegate functions are not called. What do you mean "cannot use different fonts while using this pod" ? Please be more specific.

JeremPlln commented 5 years ago

I don't know if you guys are still facing the issue, but I did find a way to fire the delegate methods. All I had to do was to set the properties shouldCollapse & shouldExpand to true.

your_label.shouldCollapse = true
your_label.shouldExpand = true