Post

After yesterday’s example of the new button roles, I want to go a bit in depth as I mixed up a few things. With iOS 26, there are now four button roles: close and confirm (26+), destructive and cancel (15+). #iOSDev #SwiftUI

The destructive role for me is an absolute no-brainer. It has the label „delete“, a red tint, and trash as an icon. Based on the location, different properties are displayed.

0 reposts0 likes

The years-old cancel role shows the title key as text in the toolbar from 15 to 18, and since 26+, the xmark-ish button. According to the docs, a cancel button causes the user to lose progress.

With 26, there is the new close role. It looks in the toolbar the same as the cancel button, but signals that no progress is lost when tapping it.

Last but not least, there is the new confirm role. This is the first and only role to accept/apply some kind of action. This button has the app’s accent color as tint and has a checkmark as a symbol.

Here are all four roles in the toolbar in action. You can hear the difference with VoiceOver enabled, although none of the title keys are given thanks to the new OS 26+ (role, action) initializer.