swiftmacosurlswift3nsimage

How to convert URL to NSImage (Swift 3)


I need to create an NSImage from a url. I want to be able to use it in my Mac application.

enter image description here

Please Help!!


Solution

  • let image = NSImage(data: Data(contentsOf: url))