Question

Im using CoreText to display some text, creating framesetter, frames and so, and everything is fine. I can even format the text, but this all is done before I draw. Now the question that is driving me crazy:

CoreText is just to render text? I cannot get any reference to CTRuns or Glyphs to highlight them?

Another sub big question, the Pages App dont use CoreText, anyone knows? In Pages, you can select any already drawn styled text!

All I want is to draw the text and be able to let the user tap to select any text or doubleTap to select the paragraph.

Please, anyone, any light?

Thanks in advance.

Was it helpful?

Solution

CoreText is just to render text. Implementing user interaction is quite another matter. You need to implement UITextInput protocol, see here. It's a big job.

If you just want to input text and don't have a need for advanced typography, just use UITextView or UIWebView.

OTHER TIPS

you can get image bounds of CTLines and CRRuns via core text here is little example i made for my app it's not perfect yet but you can get a little idea of how it works.

textViewProject

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top