Your Second iOS & SwiftUI App

Nov 4 2021 Swift 5.5, iOS 15, Xcode 13

Part 2: Data Flow

15. Challenge: Image Deletion Button

Episode complete

Play next episode

Next
About this episode
See versions

Leave a rating/review

See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 14. Confirmation Dialogs Next episode: 16. Model Objects

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Pro subscription. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

This video Challenge: Image Deletion Button was last updated on Nov 4 2021

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

So, you can delete images, now? And you’ve got a button to go through with it, on your confirmation dialog… How about another button …to launch the dialog when you actually need it?!

.confirmationDialog(isPresented: .constant(true)) {
  @State var showingImagePicker = false
  @State var showingDialog = false

  var body: some View {
.confirmationDialoge(...., isPresented: $showingDialog) {
        .scaledToFit()

        HStack {
          Button("Update Image…") {
            showingImagePicker = true
          }
          .padding()
        }
      }

            showingImagePicker = true
          }
        }
        .padding()
        HStack {
          Button("Update Image…") {
            showingImagePicker = true
          }

          Button("Update Image…") {
            showingImagePicker = true
          }
Button("Delete Image…") {
Image") {
          Button("Delete Image") {
            showingDialog = true
          }
            showingDialog = true
          }

          Spacer()

          Button("Update Image…") {
        HStack {
          Spacer()

          Button("Delete Image") {
          Spacer()
        }
        .padding()
      HStack {
        if image != nil {
          Spacer()
          Button("Delete Image") { showingDialog = true }
        }