Load app icon from xcassets on OS X

875 Views Asked by At

I can't load another app icon into NSImage. I tried to use both asset name and name of the particular file but image is always nil.

let image = NSImage(named: "Alerted")
//let alertedDog = NSImage(named: "Alerted128x128.png")

image?.size = NSSize(width: 128, height: 128)
NSApp.applicationIconImage = image
NSApp.dockTile.display()

Any thoughts?

In packaged file I see only standard AppIcon.icns and there is no Alerted.icns...

1

There are 1 best solutions below

0
On

There are two types of icons. Additional should be of generic type.