I am creating an application using UIActionSheet. When I implement action sheet I saw an destructive button on the action sheet. My action sheet also contains a 'Cancel' button and when I tap on 'Cancel' button it will dismiss the action sheet,
but I am not understanding what is the role of 'destructive' button here.
Can any one explain me.
Tarun Kumar
26-Nov-2015UIActionSheet's destructive button is added to the action sheet automatically and assigned an appropriate index, which is available from the destructiveButtonIndex property.
destructive button is displayed in red to indicate that it represents a destructive behavior.(if you do not want destructive button then Specify nil in the parameter of action sheet method).
I always use destructive button as a delete button, so that its background color is in red.
Use action sheet's clickedButtonAtIndex: method to set actions on any index button:
Here is the method: