Xcode how to autostart UITextView?

I have a Text View window, and I want this rectangle to remain the same size, while the text inside the autostart box matches the size of the window. The reason I need this is because the text is pulled from plist, and the lines have different lengths. Shortcuts have an autostart function, which is exactly what I want, but I can’t figure out a way, even through the code, to get a text view to do the same. Please, help!

+5
source share
1 answer

UILabelmay have more than one line of text. You just need to install the following:

label.lineBreakMode = UILineBreakModeWordWrap;
label.numberOfLines = 0; // 0 = unlimited number of lines, set to another number to have that as maximum

, , label.adjustsFontSizeToFitWidth = YES;, , .

+2

All Articles