get point inside text draw xcode
<p>i wrote a code to write text on uiview using CGContextRef
in the drawRect </p>

<pre><code>UIFont *font =  [UIFont fontWithName:@"Thonburi-Bold" size:400.0];
CGPoint point = CGPointMake(50.0,0.0);

CGContextRef context = UIGraphicsGetCurrentContext();


CGContextSetRGBFillColor(context, 1.0, 1.0, 0.9, 0.9);
CGContextSetRGBStrokeColor(context, 0.0, 0.0, 0.0, 1.0);

CGContextSetTextDrawingMode(context, kCGTextFillStroke);

CGContextSaveGState(context);


CGContextBeginPath(context);
NSString *x=@"1";
[x drawAtPoint:point withFont:font];
CGContextClosePath(context);
CGContextDrawPath(context, kCGPathFillStroke);

CGContextAddPath(context,pathref);
//pathref=CGContextCopyPath(context);

CGContextRestoreGState(context);
</code></pre>

<p>then i'm trying to detect user touch inside the text using</p>

<pre><code> if(CGContextPathContainsPoint(context, touchlocation, kCGPathFillStroke))
</code></pre>

<p>but it doesn't work
i tried to find the if cgcontext contains path using</p>

<pre><code> CGContextIsPathEmpty(context)
</code></pre>

<p>and it always returns 1</p>

<p>i don't know how to fix it , and i want to get only the touches inside the drawing text</p>

<p>thanks </p>
