Episode #435

Working with Alerts in SwiftUI

11 minutes
Published on April 7, 2020

This video is only available to subscribers. Get access to this video and 573 others.

In UIKit we use imperative code to do things like display alerts, but in SwiftUI we have a declarative structure. In this episode we will see how this changes how we work with alerts. We'll look at two ways of showing alerts, one with a simple boolean state variable, and one with a bindable identifiable type that is passed to our alert, which we use to show a specific error message if an operation fails.

This episode uses Xcode 11.4, Swift 5.2.