show alert swiftui
struct ContentView: View {
@State var showsAlert = false
var body: some View {
Button(action: {
self.showsAlert.toggle()
}) {
Text("Show Alert")
}
.alert(isPresented: self.$showsAlert) {
Alert(title: Text("Hello"))
}
}
}
Also in Swift:
- predicate realm bool swift
- swift change enum value
- hide bottom tab bar swift
- swift uitableview insert cell
- swift how to make a variable
- swift update uilabel text button
- swift close app
- register for remote notifications swift
- swiftui background color
- swiftui font color
- how to dismiss a view when touch up inside swift
- IOS create UIAlertViewController programmatically
- swift wait 5 seconds
- show alert swiftui
- uilabel font size swift
- remove child from firebase swift
- swift declare optional values
- swift corner radious of view controller
- swift switch
- swift how to add a completion block to a function
- deselect all cell in collectionview
- xcode how to know which textfield is selected
- time formats swift
- swift open url