Is there a way to access an Icon Composer .icon file in Swift or Objective-C? Any way to get this in an NSImage object that I can display in an image view? Thanks.
Access .icon files in Swift or Objective-C
You can use
Swift
NSImage(named:"Icon_Composer_Name")
or
Objective-C
[NSImage imageNamed:@"Icon_Composer_Name"]
to access the icon Composer file.
In the example below, an image view displays an image that uses an Icon Composer file named "AppIcon-Blue" if found.
if let image = NSImage(named: "AppIcon-Blue") {
myImageView.image = image
}
Hi @DTS Engineer!
Unfortunately this seems not to work anymore. I remember it worked until beta 3 or so but now the returned NSImage object is just null.