Post

Replies

Boosts

Views

Activity

Reply to Access .icon files in Swift or Objective-C
Hi @DTS Engineer! Yes, the asset catalog is inside the plugin bundle and I can access other assets (png) without problems. To make things easier I created a simple app and added some .icon files to it. First I tried to access them using imageNamed: which doesn't work. Then I copied the icon files to the app's Resources folder, got the actual image path using [[NSBundle mainBundle] pathForResource:@"MyIcon" ofType:@"icon"] (which worked) and then to get an image using [[NSImage alloc] initWithContentsOfFile:iconPath] which returned null. So the issue is not about the Dock Tile plug in but a more general issue.
Topic: UI Frameworks SubTopic: AppKit Tags:
Sep ’25
Reply to Access .icon files in Swift or Objective-C
Enabling Include all app icon assets did the trick and I was able to access the icon by its name. Unfortunately, the icon is always rendered in its default appearance and does not adopt the current appearance, such as dark or tinted. Any chance to make this work? Is there a supported way to get the current appearance request the image in a specific appearance receive a notification if the appearance changes? The last point would also be necessary if I were using a regular asset set with PNG representations of the .icon file. Thanks, Marc
Topic: UI Frameworks SubTopic: AppKit Tags:
Sep ’25
Reply to Access .icon files in Swift or Objective-C
I'm not sure if it will work with icon assets specifically, but "Supporting Dark Mode in your interface" and "Providing images for different appearances" cover all of these issues. Note that while both of those articles are in the UIKit section, they also cover AppKit. Thanks, but unfortunately this does not work with the new icon styles. Best regards, Marc
Topic: UI Frameworks SubTopic: AppKit Tags:
Sep ’25