I have bunch of images in my assets. What I am trying to do is render the image in status bar of OSX as following:
let icon = NSImage(named: "statusIcon")
icon?.size = NSSize.init(width: 18, height: 18)
icon?.template = true
statusItem.image = icon
statusItem.menu = statusMenu
and also using it in one of my view which opens:
self.dayIcon.image = NSImage(named: "statusIcon")
The problem is as soon as I set the status bar image, the image in the view also changes, i.e. both the color and the size(changes to 18x18)
I have tried using
icon?.cacheMode = NSImageCacheMode.Never
but there is no effect.
Is this how it is supposed to be? Can I not use the same image and render it differently at different places. They are both different NSImage
instances.