Chapter 5: Presenting Extra Information to the User

In this chapter, we shall look at how to present extra information to the user using alerts, modals, context menus, and popovers.

When interacting with mobile applications, we expect a certain level of handholding. If we are about to perform an irreversible action such as delete a file, we expect an alert to pop up and ask for confirmation if we want to perform the requested action. Depending on our response, the file may be deleted or not. We also expect to click on certain buttons/links to see extra information regarding a topic.

Since SwiftUI is a declarative programming language, presenting extra information to the user involves adding modifiers to already existing views. It is possible ...

Get SwiftUI Cookbook 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.