Customized Ellipsis on UILabel
Ellipsis (plural ellipses) is a series of dots that usually indicates an intentional omission of a word, sentence, or whole section from a text without altering its original meaning.1
In UILabel ellipsis ‘…’ show up when text is to long to fit in label frame:

Currenlty in UILabel there isn’t an easy way to customize the ellipses and change them to something like in Appstore reviews:

###Introducing DSExpandingLabelWithCustomEllipsis:
Inspired by an answer on Stackoverflow - a) Store the full text for later expanding b) Trim the full text so it will fit in the required number of lines while considering the custom ellipsis.
DSExpandingLabelWithCustomEllipsis attributes:
- Using attributed text, for really custom ellipses.
- Finds the trimed text length using binary search.
- Does not use deprecated
sizeWithFont
- Simple to use.
Usage:
1 |
|
Check it out on Github: DSExpandingLabelWithCustomEllipsis