To create a custom label with two lines and truncating the tail in Swift, you can use the UILabel
class and set the numberOfLines
property to 2
. For truncation, you can use the lineBreakMode
property to set the mode to .byTruncatingTail
. Here is an example code snippet:
main.swift182 chars5 lines
This will create a UILabel
with two lines and truncate the text at the end of the second line with an ellipsis.
gistlibby LogSnag