Swift Button

[Solved] Swift Button | Swift - Code Explorer | yomemimo.com
Question : swift button

Answered by : tawhid-bin-omar

//Declaration
struct Button<Label> where Label : View
//Overview
/*You create a button by providing an action and a label.
The action is either a method or closure property that does
something when a user clicks or taps the button. The label is
a view that describes the button’s action — for example, by
showing text, an icon, or both:*/
Button(action: signIn) { Text("Sign In")
}
/*For the common case of text-only labels, you can use the
convenience initializer that takes a title string LocalizedStringKey as its first
parameter,instead of trailing a closure*/
Button("Sign In", action: signIn)

Source : | Last Update : Fri, 18 Mar 22

Answers related to swift button

Code Explorer Popular Question For Swift