By default, UILabels truncate text and then put an ellipsis on the end.
How might I wrap all the text, including the ellipse, in double quotes?
By default, UILabels truncate text and then put an ellipsis on the end.
How might I wrap all the text, including the ellipse, in double quotes?
Unless there's an even better convenience method on the iPhone that I don't know about, I think the easiest and most flexible thing to do would be to subclass UILabel and implement your own drawing and truncation, using the various sizeWithFont extensions to determine the width of the string and each set of quotes individually.
Is your label text predictably going to result in truncation (and thus always have the ellipse)? I doubt it, but in case it does, you know the content is going to basically fill the width, so you can make the quote marks other UILabels (or even images). This would give you font and color control as well.
Use two UILable
s, the first holds the text (plus an open-quote), and the second just holds a close-quote:
["text that is lon…]["]