CraftMcMatt CraftMcMatt - 1 year ago 78
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 Source

[NSGraphicsContext currentContext].CGContext.

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