How can i find attribute of the text (it’s NSAttributedString where each sentence have it’s unique atribute) below the tap position of the view, while using NSAttributedString with Core Text Framework?
How can i find attribute of the text (it’s NSAttributedString where each sentence have
Share
Using Core Text directly, not a text view? I assume you have a
CTFrameRef. You can get the lines and the line origins usingCTFrameGetLines()andCTFrameGetLineOrigins(). Find the right line based on its origin and then useCTLineGetStringIndexForPosition()to get the string index.