UIAction is deprecated in iOS 8. (Note that
UIAction is also deprecated.) To create and manage action sheets in iOS 8 and later, use
- iOS 2.0+
- Mac Catalyst 13.0+
UIAction protocol defines the methods a delegate of a
UIAction object should implement. The delegate implements the button actions and any other custom behavior. Some of the methods defined in this protocol are optional.
If you add your own buttons or customize the behavior of an action sheet, implement a delegate conforming to this protocol to handle the corresponding delegate messages. Use the
delegate property of the action sheet object to specify one of your application objects as the delegate.
If you add your own buttons to an action sheet, the delegate must implement the
action message to respond when those buttons are clicked; otherwise, your custom buttons do nothing. The action sheet is automatically dismissed after the
action delegate method is invoked.
Optionally, you can implement the
action method to take the appropriate action when the system cancels your action sheet. If the delegate does not implement this method, the default behavior is to simulate the user clicking the cancel button and closing the view.
You can also optionally augment the behavior of presenting and dismissing action sheets using the methods in Customizing Behavior.