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 might want to interrupt to give the user some information or to ask the user how to proceed. For this purpose, iOS provides two types of rudimentary modal dialog — 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 pressing with 3D touch on your app’s icon in the home screen.

  • 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 a modal dialog displaying icons representing activities. Activities are possible courses of external and internal action, such as handing off data to Mail or Messages, or processing it internally. Your app can present an activity view; you can also provide your own activities, either privately within your app ...

Get Programming iOS 11 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.