The name says it all.
I am trying to understand what is the equivalent of UIGraphicsGetCurrentContext() for OS X.
UIGraphicsGetCurrentContext()
[NSGraphicsContext currentContext].CGContext .
[NSGraphicsContext currentContext].CGContext
(The -CGContext property -CGContext available in 10.10 and later, in earlier versions you can use graphicsPort .)
-CGContext
graphicsPort
For Swift: NSGraphicsContext.currentContext()?.CGContext
NSGraphicsContext.currentContext()?.CGContext
Just for completeness, in Swift 4 the syntax is:
NSGraphicsContext.current?.cgContext