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()
}
}
outPut
Top comments (0)