How can I convert a NSImage to CGImage in Swift? In Objective-C I did it like this:
- (CGImageRef)CGImage { NSData *imageData = self.TIFFRepresentation;
Swift 3 and 4 version code :-
if let image = NSImage(named: "Icon"){ let cgImage = image.cgImage(forProposedRect: nil, context: nil, hints: nil) }