NSAlert Replacement for Big Sur Allowing Longer Messages

In my app, I have a few dialogs that display alerts with long messages, usually in the form of instructions to the user on how to change a system setting. Because Big Sur's dialogs are vertically oriented and reduced in size, those main message and the informational message in those alerts would be cut off and thus unreadable by the user.

NSCustomAlert implements a direct replacement for NSAlert. that mimics the appearance and behavior of alerts on macOS Catalina and earlier.

Furthermore, the code will decide whether to use a native NSAlert or NSCustomAlert based on the length of the text to be displayed.

MIT License. Git Hub repro is:

https://github.com/TroikaTronix/NSCustomAlert

That's great!!

Thanks for putting it together. I thought of creating my own replacement, but your project seems to do exactly what I need (as well as any other Mac developer, in my view).

The redesigned NSAlert on Big Sur is a total disaster. In addition to cutting off long messages, the center-aligned text is simply not suitable for human consumption. The entire centered alignment of elements is also tasteless and visually unappealing.

Those who designed the alerts lack the very basic knowledge of text legibility as well as human-oriented UI design in general.

It's a big embarrassment for Apple. They're supposed to have the best UI designers in the world. And yet it looks like Apple just grabs random people from the street to design certain UI elements. Sadly, despite overwhelmingly negative feedback from both users and developers, nothing was changed on Monterey.

I hope to implement NSCustomAlert in all my apps as soon as possible. And hope that other developers will follow the suit.

P.S. In your current code, the alert cannot be moved with the mouse. I solved this issue by removing the NSWindowStyleMaskDocModalWindow mask AND adding _panel.movableByWindowBackground = YES. I'll post this feedback on git as well.

NSAlert Replacement for Big Sur Allowing Longer Messages
 
 
Q