Objective-c – When to use a UIAlertView vs. UIActionSheet

alertscocoa-touchiphoneobjective c

Are there situations where a UIAlertView is better to use than a UIActionSheet? What are the typical scenarios where you would use one over the other?

I'm programming a navigation bar button to open a UIWebView in an external application, and at first I started programming a UIAlertView, then I thought that an action sheet might be better for this situation.

Are there any formal guidelines for which to use in different situations? Thanks.

Best Answer

From Apple's iPhone Human Interface Guidelines:

Alerts, action sheets, and modal views are designed to communicate different things:

  • Alerts give users important information that affects their use of the application (or the device). Alerts are usually unexpected, because they generally tell users about a problem or a change in the current situation that might require users to take action.
  • Action sheets give users additional choices related to the action they are currently taking. Users learn to expect the appearance of an action sheet when they tap a toolbar button that begins either a potentially destructive action (such as deleting all recent calls) or an action that can be completed in different ways (such as a send action for which users can specify one of several destinations).
  • Modal views provide more extensive functionality in the context of the current task or provide a way to perform a subtask directly related to the user’s workflow.
Related Topic