Protocol: UIActionSheetDelegate

Overview

The UIActionSheetDelegate protocol defines the methods a delegate of a UIActionSheet object should implement. The delegate implements the button actions and any other custom behavior. Some of the methods defined in this protocol are optional.Sent to the delegate when the user clicks a button on an action sheet.Sent to the delegate after an action sheet is dismissed from the screen.Sent to the delegate before an action sheet is dismissed.Sent to the delegate before an action sheet is canceled.Sent to the delegate after an action sheet is presented to the user. Sent to the delegate before an action sheet is presented to the user.

Instance Method Summary (collapse)

Instance Method Details

- (Object) actionSheet(actionSheet, clickedButtonAtIndex:buttonIndex)

Sent to the delegate when the user clicks a button on an action sheet. The receiver is automatically dismissed after this method is invoked.

Parameters:

  • actionSheet (UIActionSheet)

    The action sheet containing the button.

  • buttonIndex (Integer)

    The position of the clicked button. The button indices start at 0.

Returns:

- (Object) actionSheet(actionSheet, didDismissWithButtonIndex:buttonIndex)

Sent to the delegate after an action sheet is dismissed from the screen. This method is invoked after the animation ends and the view is hidden.

Parameters:

  • actionSheet (UIActionSheet)

    The action sheet that was dismissed.

  • buttonIndex (Integer)

    The index of the button that was clicked. The button indices start at 0. If this is the cancel button index, the action sheet is canceling. If -1, the cancel button index is not set.

Returns:

- (Object) actionSheet(actionSheet, willDismissWithButtonIndex:buttonIndex)

Sent to the delegate before an action sheet is dismissed. This method is invoked before the animation begins and the view is hidden.

Parameters:

  • actionSheet (UIActionSheet)

    The action sheet that is about to be dismissed.

  • buttonIndex (Integer)

    The index of the button that was clicked. If this is the cancel button index, the action sheet is canceling. If -1, the cancel button index is not set.

Returns:

- (Object) actionSheetCancel(actionSheet)

Sent to the delegate before an action sheet is canceled. If the action sheet’s delegate does not implement this method, clicking the cancel button is simulated and the action sheet is dismissed. Implement this method if you need to perform some actions before an action sheet is canceled. An action sheet can be canceled at any time by the system—for example, when the user taps the Home button. The actionSheet:willDismissWithButtonIndex: and actionSheet:didDismissWithButtonIndex: methods are invoked after this method.

Parameters:

  • actionSheet (UIActionSheet)

    The action sheet that will be canceled.

Returns:

- (Object) didPresentActionSheet(actionSheet)

Sent to the delegate after an action sheet is presented to the user.

Parameters:

  • actionSheet (UIActionSheet)

    The action sheet that was displayed.

Returns:

- (Object) willPresentActionSheet(actionSheet)

Sent to the delegate before an action sheet is presented to the user.

Parameters:

  • actionSheet (UIActionSheet)

    The action sheet that is about to be displayed.

Returns: