Search code examples
objective-cuibuttonuiactionsheet

UIActionSheet - add disabled button


Is there a way to add a disabled (non-clickable, greyed out) button to a UIActionSheet?

All I see is "addButtonWithTitle" which does not supply any properties to work with.


Solution

  • I believe there is no way to add disabled button in a UIActionSheet. From the class reference:

    Use the UIActionSheet class to present the user with a set of alternatives for how to proceed with a given task. You can also use action sheets to prompt the user to confirm a potentially dangerous action. The action sheet contains an optional title and one or more buttons, each of which corresponds to an action to take.

    If the button is disabled, it should not be added into the UIActionSheet in the first place since it is not an alternative on how to proceed with a given task.