Home > DeveloperSection > Forums > How to remove RedDestructive Button from UIActionSheet in iOS
Betty Thomas
Betty Thomas

Total Post:5

Points:35
Posted on    November-26-2015 1:52 AM

 iPhone iPhone  Ios  Objective C 
Ratings:


 1 Reply(s)
 312  View(s)
Rate this:

I have created an application using UIActionSheet that pops up on the screen.

But I don't need to have destructive button on our action sheet. If I will try to remove the destructive button from the code then I get an error: No visible interface for UIActionSheet.


So, how can I remove the red destructive button from the action sheet.!



Tarun Kumar

Total Post:210

Points:1614
Supported
Posted on    November-26-2015 11:11 PM

Yes, you can remove destructive button from action sheet: 
in the parameter of action sheet method 'initWithTitle:' pass nil in the destructiveButtonTitle parameter.
For example:

UIActionSheet *actionSheet = [[UIActionSheet alloc]

initWithTitle:actionSheetTitle

delegate:self

cancelButtonTitle:cancelTitle

destructiveButtonTitle:nil

otherButtonTitles:images, vedios, files, nil];


Don't want to miss updates? Please click the below button!

Follow MindStick