Configure UIActionSheet

alt text

Can we change the order in which the destroy button and other buttons appear in the UIActionSheet. By default, a destructive button (red) appears above the other buttons, in my application, I would like other buttons to appear above the destructive button.

+4
source share
2 answers

You can make any button in a UIActionSheet as a destroy button using the UIActionSheet destructiveButtonIndex property, for example

actionSheet.destructiveButtonIndex = 1; 
+2
source

No problems.

Just select and run a new instance of UIActionSheet and add buttons to your order (one after the other) with –addButtonWithTitle: This method returns you the index into which the button was added. You can then set the index of the destructive button with -setDestructiveButtonIndex:

+6
source

Source: https://habr.com/ru/post/1336125/


All Articles