Anyone an idea how to create an Alert in SwiftUI that contains a TextField?
Step1: Make root view as ZStack
Step2: Add variable for show/hide
@State var showAlert = false
Step 3: Add this custom layout inside root view (ZStack)
if $showAlert.wrappedValue {
ZStack() {
Color.grayBackground
VStack {
//your custom layout text fields buttons
}.padding()
}
.frame(width: 300, height: 180,alignment: .center)
.cornerRadius(20).shadow(radius: 20)
}