Using body text directly, not text representation? I guess you have one CTFrameRef. You can get strings and source strings using CTFrameGetLines()and CTFrameGetLineOrigins(). Find the correct line based on its beginning, and then use CTLineGetStringIndexForPosition()to get the index of the line.
source
share