I want to load long text in TextViews of different Views. The text should be divided to pages when it reaches end of the textviews. And the next textview must start with the continuation of the text.
I have gone through a lot of answers. But all specifies about limiting text content when entering data. I want to display paged data in TextView. And there wont be any entering or editing in it. So the delegate methods regarding that won't work.
I tried to load text of fixed length. but it is not correct when the no.of paragraphs varies.
So what i am trying to find is , get notified when the the text reaches end of textview's capacity or getting the capacity of textview as per no lines/ no.of characters. Is there any way to do this ???
Update
As per the comments i have got, i searched a lot and reached at NSTextStorage, NSTextLayoutManager and NSTextContainer
I have found this link which will help to easily implement pagination
http://sketchytech.blogspot.co.uk/2013/11/paging-and-paginating-easy-way-with.html
I this example they have created 4 objects using loop. It can be said as they have splitted the string to 4 parts and displayed in 4 uitextviews of a scrollview.
I am trying to set a condition to split to textcontainers according to the length of string. I trying to create a condition by considering the total length of main string & the text displayed in textviews.
But each textview' text length is same as the total length of the main string. So how i could get the length text displayed in each textcontainer of textview ????