2

Working on an app that needs to take a large amount of text, paginate it based on user selected font size, etc., and display it with styles. Getting UIWebView to paginate a document has proven extremely troublesome. I have seen a wrapper for Core Text that apparently, takes care of layout, but my understanding is that core text cannot be selected.

Anyone know how they accomplished this? I had assumed it was UIWebView.

Thanks in advance.

cyberworld
  • 694
  • 7
  • 22

1 Answers1

0

Prior to 3.2 displaying formatted text other than in a webview was nigh inpossible. Since then though we have NSAttributedString and corresponding UiKit elements which can display some font variations, colouring, formatting within one string. Pagination and other behaviour is outside of its scope though, and you would have to implement it yourself via a pageable scrollview as one possibility. Selection will also prove difficult, as you would have to implement it yourself again by ways of UiView hit detection on your UILabels and by implementing touchesBegan:, touchesMoved: and touchesEnded: and drawing the selection yourself.

Take a look at UITextView with Syntax Highlighting

Good luck!

Community
  • 1
  • 1
rage
  • 1,447
  • 16
  • 16