I used CoreText
to layout a custom view. Want to know on which word I tapped on event/gesture with CoreText
.
I did following code within my drawRect:
CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor);
CGContextSelectFont(context, "Helvetica-Bold", FONTSIZE, kCGEncodingMacRoman);
//setSpan
CGContextSetTextPosition(context, 0, (200+offset) - (i*25));
CGContextShowText(context,[[dispLineArray objectAtIndex:i] UTF8String], strlen([[dispLineArray objectAtIndex:i] UTF8String]));