Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show more button next to end of text Swift

I want to show more button at the end of the text or below if there isn't enough space. I don't understand how Apple developers did this? Please answer in swift. After clicking on more button i want to show all the text. change the button to less.

Thanks in advance.

enter image description here

like image 549
Anirudha Mahale Avatar asked Nov 14 '16 06:11

Anirudha Mahale


1 Answers

Here's a great CocoaPod for the functionality you're looking for.

https://github.com/ilyapuchka/ReadMoreTextView

This will allow you to set a maximum number of lines and customise the text append to the end of the trimmed text. You can change the font and color since it is an NSAttributedString.

like image 65
Callam Avatar answered Nov 15 '22 14:11

Callam