Search code examples
iphoneiosquartz-graphics

how to set a context to NSString drawAtPoint?


I currently working on encapsulation many [NSString drawAtPoint:withFont:] function calls to a method so that I could draw lots of strings by a single call, but how can I tell the method where to draw these strings?

What if I pass a CGContextRef to it, how to set a CGContextRef as current context?


Solution

  • Maybe you need this part of code:

    CGContextRef context = UIGraphicsGetCurrentContext();