confirmationDialog() in swiftUI
Saurabh Chavan

Saurabh Chavan @100rabhcsmc

About: React Native,iOS, SwiftUI 💻🥣🛌🔄

Location:
Pune,Maharashtra
Joined:
Jun 26, 2020

confirmationDialog() in swiftUI

Publish Date: Mar 24 '23
1 0

confirmationDialog is basically a alert message which comes from the bottom

if you instagram user then I am sure you will saw this pop which comes from the bottom

the code and output are as follow:

import SwiftUI

struct ContentView: View {
   @State private var showConfirmation = false

    var body: some View{
        Button("Click me") {
            showConfirmation = true
        }
        .confirmationDialog("Value", isPresented: $showConfirmation) {
            Button("Save"){}
            Button("Delete",role: .destructive){}
            Button("cance",role: .cancel){}
        }
    }
}




struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
Enter fullscreen mode Exit fullscreen mode

outPut

Image description

Comments 0 total

    Add comment