Pop Ups

Action Sheets

The UIActionSheet is used to ask a question with many possible answers.

When any button is selected, the sheet animates out of the view again. The destructive button is at the top and tinted in red. The cancel button is at the bottom and tinted in black. The remaining buttons are in between, in default grey.

The action sheet slides up from the bottom of the screen on iPhone and iPod, and appears in a popover on iPad.

To read and handle the selection in a UIActionSheet, an object must conform to the UIActionSheetDelegate protocol and set itself as that sheet’s delegate.

Alerts

The UIAlertView is used to ask a question with only two answers (YES/NO, OK/CANCEL), or to inform the user of something going wrong. It is very disruptive to the user experience and should be used sparingly.

Similarly to the UIActionSheet, to read and handle the selection in a UIAlertView, an object must conform to the UIAlertViewDelegate protocol and set itself as that alert’s delegate.

Comments are closed.