CraftMcMatt CraftMcMatt - 4 months ago 18
Objective-C Question

What is the UIGraphicsGetCurrentContext() equivalent for OS X?

Title says it all.

I'm trying to figure out what the

UIGraphicsGetCurrentContext()
equivalent is for OS X.

Answer

[NSGraphicsContext currentContext].CGContext.

(The -CGContext property is available in 10.10 and later; in earlier versions, you can use graphicsPort.)

Comments