Reputation: 8384
I've got a variable-width-font NSString that has to fit inside a fixed size UIView. Currently, the string gets truncated and rendered.
I want to obtain the visible substring so I can append an elipsis (…) to it.
Upvotes: 1
Views: 477
Reputation: 14446
If you're using a UILabel
, you can set the lineBreakMode
to one of
UILineBreakModeHeadTruncation
UILineBreakModeTailTruncation
UILineBreakModeMiddleTruncation
The different positions refer to where the ...
goes. You want UILineBreakModeTailTruncation
.
Upvotes: 1