- (void)drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSelectFont(context, "Arial", 24, kCGEncodingMacRoman);
CGContextShowTextAtPoint(context, 80, 80, "I am Rahul", 7);
}
I am trying to draw text as shown above "I am Rahul" but when i execute the code,
text gets shown, but it is inverted, why it is happening I am not getting !! help!!
You can use this code :
CGContextSetTextMatrix(context, CGAffineTransformMake(1.0,0.0, 0.0, -1.0, 0.0, 0.0));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With