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 to add one or several such modifiers to a view and set the conditions for each to be triggered.
The list of topics for this chapter is as follows:
- Presenting alerts
- Adding actions to alert buttons
- Presenting multiple alerts...