I have 4 buttons in UIActionsheet from Top to Bottom Sequence is as below
1. Remove existing photo - Destructive button title
2. take picture - other button title
3. choose from library - other button title
4. Cancel - cancel button title
Now what my question is i found my 1st button "Remove existing photo" in red color obviously and i want my 1st button at 3rd place with red color and other buttons as 1st button and 2nd button but don't know how i can get it.
You can use destructiveButtonIndex
to set the 3rd button as destructive button.
like this actioinSheet.destructiveButtonIndex = 3;
Action sheet buttons appear in the order in which you add them to the action sheet. Add them in the order in which you would like them to appear. You can set the cancelButtonIndex
and destructiveButtonIndex
to determine which buttons should be styled with the cancel and destructive styles.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With