Title says it all.
I'm trying to figure out what the UIGraphicsGetCurrentContext()
equivalent is for OS X.
Just for completeness, in Swift 4, the syntax is:
NSGraphicsContext.current?.cgContext
[NSGraphicsContext currentContext].CGContext
.
(The -CGContext
property is available in 10.10 and later; in earlier versions, you can use graphicsPort
.)
For Swift:
NSGraphicsContext.currentContext()?.CGContext
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