How do I locate the CGRect for a substring of text in a UILabel?
- by bryanjclark
For a given NSRange, I'd like to find a CGRect in a UILabel that corresponds to the glyphs of that NSRange. For example, I'd like to find the CGRect that contains the word "dog" in the sentence "The quick brown fox jumps over the lazy dog."
The trick is, the UILabel has multiple lines, and the text is really attributedText, so it's a bit tough…