I have the current code that's working for ios.But as many of you know UIKit isn't in Mac OSX apps.How could I save a nsimage with the subviews I added
private func screenShotMethod() -> NSImage? {
//Create the UIImage
NSGraphicsBeginImageContext(self.pickedImge.frame.size)
self.pickedImge.layer.render(in: UIGraphicsGetCurrentContext()!)
let image = NSGraphicsGetImageFromCurrentImageContext()
NSGraphicsEndImageContext()
//Save it to the camera roll
UIImageWriteToSavedPhotosAlbum(image!, nil, nil, nil)
return image!
}