Your Second iOS & SwiftUI App

Nov 4 2021 Swift 5.5, iOS 15, Xcode 13

Part 2: Data Flow

14. Confirmation Dialogs

Lesson Complete

Play Next Lesson
Next
Save for later
About this episode
See versions

See course reviews

See forum comments
Cinema mode Mark as Complete Download course materials
Previous episode: 13. Color Schemes Next episode: 15. Challenge: Image Deletion Button

This video was last updated on Nov 4 2021

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

You can unlock the rest of this video course, and our entire catalogue of books and videos, with a kodeco.com Professional subscription.

At this point, you’re providing a way for users to set images for books, and update them. But there may be cases where they’d like to delete their custom images, and go back to the default.

      PHPickerViewController.View(image: $image)
    }
    .confirmationDialog(<#T##title: StringProtocol##StringProtocol#>, isPresented: <#T##Binding<Bool>#>, actions: <#T##() -> View#>, message: <#T##() -> View#>)
  }
    .confirmationDialog(
      "Delete image for \(book.title)?",
image: .constant(nil))
.alert(isPresented: .constant(true)) {
      isPresented: .constant(true)) {
        <#code#>
      } message: {
        🟩Text("Delete image for \(book.title)?")
      }
Button("Delete")
Button("Delete", role: .destructive)
Button("Delete", role: .destructive) { image = nil }