I Need to take a screenshot of a part of the screen.
This is the code to take a screenshot of the full screen in an iOS project:
UIGraphicsBeginImageContext(view.frame.size)
view.layer.renderInContext(UIGraphicsGetCurrentContext())
let imageRef = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
But how do I take a screenshot of the full screen in an Mac OS X Cocoa project ?
Thank you
