Chapter 13. Modal Dialogs

A modal dialog demands attention; while it is present, the user can do nothing other than work within it or dismiss it. This chapter discusses various forms of modal dialog:

  • Within your app, you can show alerts and action sheets. An alert is basically a message, possibly with an opportunity for text entry, and some buttons. An action sheet is effectively a column of buttons.

  • You can provide a sort of action sheet even when your app is not frontmost (or even running) by allowing the user to summon quick actions — also known as shortcut items — by long pressing on your app’s icon.

  • A local notification is an alert that the system presents on your app’s behalf, even when your app isn’t frontmost.

  • A today widget is interface that appears in the screen that the user sees by swiping sideways in the lock screen or home screen. Your app can provide a today widget by means of a today extension. Your today widget can also appear as a quick action.

  • An activity view is typically summoned by the user from a Share button. It displays possible courses of external and internal action (activities), such as handing off data to another app, or processing data within your app. Your app can also provide activities that other apps can display in their activity views, through an action extension or share extension.

Alerts and Action Sheets

Alerts and action sheets are both forms of presented view controller (Chapter 6). They are managed through the UIAlertController ...

Get Programming iOS 13 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.