Wednesday, December 7, 2022
HomeiOS Developmentios - Line break after 20 characters in a label

ios – Line break after 20 characters in a label


I’ve a label. If the textual content depend in that label is 30, then after the twentieth character there ought to be a line break. How can we obtain that?

I’ve the label setup as under.

        let label = MyLabelText()
        label.numberOfLines = 2
        label.lineBreakMode = .byTruncatingTail
        label.setContentHuggingPriority(.defaultHigh, for: .horizontal)
        
    

Each line break and variety of traces are outlined. However I am unsure find out how to go to the second line after the twentieth character.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments