Top "Uilabel" questions

The UILabel class implements a read-only text view in iOS.

Vertically align text to top within a UILabel

I have a UILabel with space for two lines of text. Sometimes, when the text is too short, this text …

ios cocoa-touch uikit uilabel text-alignment
Multiple lines of text in UILabel

Is there a way to have multiple lines of text in UILabel like in the UITextView or should I use …

ios uilabel uitextview line-breaks multiline
How do I make an attributed string using Swift?

I am trying to make a simple Coffee Calculator. I need to display the amount of coffee in grams. The "…

fonts uilabel swift nsattributedstring
UILabel text margin

I'm looking to set the left inset/margin of a UILabel and can't find a method to do so. The …

ios cocoa-touch uikit uilabel
Adjust UILabel height depending on the text

Consider I have the following text in a UILabel (a long line of dynamic text): Since the alien army vastly …

ios cocoa-touch uikit uilabel
How do I change the font size of a UILabel in Swift?

label.font.pointSize is read-only, so I'm not sure how to change it.

ios uilabel swift
How to add line break for UILabel?

Let see that I have a string look like this: NSString *longStr = @"AAAAA\nBBBBB\nCCCCC"; How do I make it …

ios iphone uilabel newline line-breaks
Adding space/padding to a UILabel

I have a UILabel where I want to add space in the top and in the bottom. With minimun height …

ios uilabel padding
UILabel - auto-size label to fit text?

Is it possible to auto-resize the UILabel box/bounds to fit the contained text? (I don't care if it ends …

ios iphone objective-c uilabel
How to control the line spacing in UILabel

Is it possible to reduce the gap between text, when put in multiple lines in a UILabel? We can set …

objective-c swift xcode uilabel line-spacing