How to use Buttons in Swift UI.

Photo by Kyle Hanson on Unsplash
struct MyView: View {
@State var isToggled = false
var body: some View {
VStack {
Button(action: {
isToggled.toggle()
}) {
Text("Press to Toggle").font(.headline)
}
}
}
}
Button(action: {
...
})
}) {
Text("Insert Button Text Here")
}

--

--

var title = “iOS Engineer @ Lunchbox”

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store