Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

limit TextView to certain number of lines in swift 2

I need to restrict my textview to only 6 lines. How do I limit my textview to 6 lines? I have put some character limit of 50 characters anyways.

like image 423
Gokulraj Rajan Avatar asked Sep 14 '25 18:09

Gokulraj Rajan


1 Answers

That is rarely simple to achieve. Try out following code

inputTextView.textContainer.maximumNumberOfLines = 6
inputTextView.textContainer.lineBreakMode = .ByWordWrapping
like image 54
Vishnu gondlekar Avatar answered Sep 16 '25 07:09

Vishnu gondlekar