Is there any way to set preferred actions for alerts in SwiftUI?
You can set .cancel roles for alert buttons, but they appear in bold and I want the other preferred action to be in bold.
I could set the preferred action to have the .cancel role, but I don't think you're supposed to do it like that.
I haven't found a proper way yet, but I haven't played around with alerts enough to know.
Thanks for any suggestions.
-
—
UberJason
Add a CommentNot sure this is helpful, but the HIG for Alerts says the cancel button should be the bold one:
"Identify destructive buttons. If an alert button results in a destructive action, such as deleting content, set the button’s style to Destructive so that it gets appropriate formatting by the system. For developer guidance, see the UIAlertActionStyleDestructive constant of UIAlertAction. Additionally, provide a Cancel button so people can safely opt out of the destructive action. Make the Cancel button bold by marking it as the default button."