On iOS, we can easily use: "try await UIApplication.shared.setAlternateIconName("iconName")" to set an alternate icon.
When running the app for MacCatalyst, that method is not working, throwing the following error:
Error Domain=NSCocoaErrorDomain Code=3328 "The requested operation couldn’t be completed because the feature is not supported."
I came across this post, from which I understand I can use NSApp to set the icon.
let nsApp = Dynamic.NSApplication.sharedApplication
let newIcon = UIImage(named: "iconName"!)
nsApp.applicationIconImage = newIcon
That code works, but only temporarily (until the app is closed).
Can anybody please help? I have seen apps like Arc browser offering this functionality on the mac.
Thank you