According to documentation doing:
let alert = NSAlert()
alert.icon = nil
alert.runModally()
should render application's icon. But I get placeholder instead.

Was just having this same problem. Initially I had only a 256@1x icon and got no icon in the alert. Once I added a 128@1x icon to the AppIcon resource however, the NSAlert displayed it properly.
And no, you don't need to explicitly set the icon to nil.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With