Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to paste long text in UITextView

Tags:

ios

iphone

How can i paste long text in UITexView because i have static text data. If i try to paste directly in to textView.text, it shows errors. How this can be managed. Please guide. Thanks in advance.

txtView.txt = @"About us

myventr.co is a web-based tool for event creation, event searching and online ticket      selling whilst also serving as a social media network. myventr.co is not just about creating events and buying tickets online but is also a place for you to socialise. You can create your own profile, connect with friends or create your own group for your organisation!

How is this different to other social media websites then? Myevent is about connecting people’s social lives and events all at the same place.  myventr.co will help find all the event details around your location and will also help avoid events clashing by simply searching the Event Calendar before creating an event.";

Above is the way i am trying.

like image 630
iPhone 7 Avatar asked Dec 02 '22 18:12

iPhone 7


2 Answers

Don't use text in next line instead use '\n' for new line.

like image 70
Baby Groot Avatar answered Dec 16 '22 03:12

Baby Groot


You cannot paste a text like that in different lines, if you want to have different lines you'll need to set them yourself with \n.

For example:

@"This is line1\nThis is line 2"
like image 28
Antonio MG Avatar answered Dec 16 '22 03:12

Antonio MG