mattt/TTTAttributedLabel — Issue #56: UILineBreakModeTailTruncation doesn't work the same in TTTAttributedLabel
Author: jasongregori
Created: 2012-02-08 22:52:36+00:00
State: open

This is more just a note to help people if you run into this. If `lineBreakMode` is set to `UILineBreakModeTailTruncation`, behind the scenes `CoreText` is using `kCTLineBreakByTruncatingTail`.

I found out the hard way that `kCTLineBreakByTruncatingTail` doesn't work the same way as `UILineBreakModeTailTruncation`.

- `kCTLineBreakByTruncatingTail` does not wrap the text and truncates each line (each line ends with a newline)
- `UILineBreakModeTailTruncation` wraps all text and truncates the end of all the text

So if you are using `UILineBreakModeTailTruncation` and you have a really long line of text, only one line of text will be drawn and it will not wrap.

Theres not really any fix we can do for this besides maybe adding a note in the comments.