I want ViewControllers to run as a “Kindle app” using UIPageViewController and my CustomTextViewController.
But I cannot find a way to get the substring NSAttributeString that matches the specific rectangle.
- I have a 70,000 character NSAttributeString.
- My CustomTextViewController has one UITextView.
- It will show the substring ATTR_STR_A by simply fitting the size into it.
- This means that a UITextView does not need to scroll.
Here is a screenshot.

In this case, the last line is not displayed!
The substring ("Before most computers were not chosen for before") is the correct string size.
How can I get this substring or the last index of the substring (the last character index of the visible string, “o” in the last word “before”)
source share