Action Sheets and Alerts for deletions

190 views Asked by At

guys. Apple in their apps for delete action sometimes use Action Sheets or Alerts. And i dont understand, when i should use Action Sheets, and when Alerts. In the HIG Apple write, that:

Alerts disrupt the user experience and should only be used in important situations like confirming purchases and destructive actions (such as deletions)

In Photos and iCloud Drive for delete action Apple use Action Sheets(This destructive actions, but they use AS), but in Reminders and Notes for same action they use Alert. Please, help, what im should using for delete: Action Sheets or Alerts. Thanx!

1

There are 1 answers

2
Sneha On

Please note that UIActionSheet & UIAlertView both are deprecated from iOS 8.0. You should use 'UIAlertController' and set preferredStyle to actionSheet

But to answer your question above

It depends on use case basis as for example UIActionSheet will be used when you have more than 2 action e.g. Like , Share, Cancel and it will be displayed differently in iPhone (From the bottom) and iPad (In centre).

UIAlertView will be used when i have only two specific action like in your above question for delete confirmation it will display OK or Cancel. Hope this helps you to decide.