As Big Sur came onto our Macs I noticed that destructive button's text in NSAlert
controller are colored in red as shown in picture.
I wasn't able to find a way to bring this feature in my app.
Using the standard addButton(withTitle:)
method we haven't any way to set its intent (such as default, cancel or destructive).
Can you give me any hint?
Thanks
Set the property hasDestructiveAction
of the button to true
. This property is new in Big Sur.
Source: AppKit Release Notes for macOS Big Sur 11
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