Alert or ActionSheet style?

Tomek Cejner
Smart Up
Published in
4 min readSep 4, 2016
Photo credit: Chance Agrella

Apps sometimes need to ask the user for confirmation of the potentially destructive action. Simply put, what should appear when a user taps “Delete” button?

One UX recommendations even say to avoid asking “are you sure”, and let undo the operation instead. Deleting a picture in Photos app moves to trash, same happens to files deleted in macOS’s Finder.

In some cases, though, undoing is impractical, and may add unnecessary complexity to the code. Also, action’s consequences are so severe, that you want to ask the user first.

There are two patterns of presenting modal dialog of choices on how to proceed. Up to iOS 7, there were two classes: UIAlertView and UIActionSheet. They are now deprecated, and since iOS8 have been unified into single UIAlertController. Former classes do have issues with proper API design, so I happily switched over to UIAlertController.

But it is not the technology which is important here. I asked myself a question: should I choose Alert or ActionSheet style for confirmation of destructive action? At first thought, both seem to play the same role. The difference lies in little details.

To my surprise, older revisions of Human Interface Guidelines, which I believe in this part are still valid to provide more light on how to choose.

Alerts

According to HIG, alerts convey relevant information related to the state of your app or the device and often request feedback. Alerts are usually unexpected; they show up when something changes and needs user attention. For example, apps are asking for a camera or microphone access when they are about to take a picture. Another example: battery is drained to below 20% of capacity, and iOS is asking to enter low power mode.

Older guidelines suggest when alerts should be avoided if they:

  • Merely increase the visibility of some information.
  • Update users on normal progress.
  • Ask for confirmation of user-initiated actions — use action sheets instead.
  • Inform users of errors or problems about which they can do nothing — rather integrate such information in the UI.

Action Sheets

HIG says:

“An action sheet is a specific style of alert that appears in response to a control or action and presents a set of two or more choices related to the current context. Use an action sheet to let people initiate tasks, or to request confirmation before performing a potentially destructive operation.”

It states clearly that action sheet is a result of user action; opposite to Alert, it is expected. It also lets present more options — alternative ways of continuation of action just initiated by a user.

Conclusion

After finding little help online, asking Twitter friends, I dug into documentation. Both alternatives seem to be similar at first sight.
What may make simple “rules of thumb” that developers love?

Alert style

Choose when your app has something important and unexpected to tell. May it be an urgent question to ask. The unforeseeable condition was met, and user needs to acknowledge that. You may come across usage of alerts in core iOS: when permission is needed to use the camera, microphone or location. To enable push notifications. Re-enter password in App Store because grace time has passed.

Alerts are infrequent; they are not part of a regular flow. Seldom appearance means that they shall be taken seriously.

Action sheet style

It is a style of alert which is a response to user action. Use to give the user alternative ways to complete a task. For example, long press on a link in Safari presents some choices: open link in a current or new tab, add to the reading list or copy URL to clipboard. It is also used to confirm deletion of calendar or address book entry.

Action sheets also are more flexible as they allow much more options than plain alert. They are also predictable and supposed to be a part of user interface flow.

Footnote: I wrote this post to share my homework done to answer question stated in the title. It is also my try to move from privately hosted WordPress site to Medium. I appreciate all feedback :)

--

--

Tomek Cejner
Smart Up

Software engineer ~20 years in business. Did variety of things including Java backend, native mobile iOS, Node.js. Currently working with Go.