Fudge
06/05/2019, 10:00 PMtapAction
modifier in SwiftUI.
Text("hello")
.tapAction { println("tapped") }
Over
Clickable(onClick = { println("tapped") }){
Text("hello")
}
You get { println("tapped") }
over
(onClick = { println("tapped") })
Andrey Kulikov
06/05/2019, 10:07 PMFudge
06/05/2019, 10:08 PMAndrey Kulikov
06/05/2019, 10:09 PMFudge
06/05/2019, 10:13 PMClickable ( { println("tapped") }){
Text ("hello")
}
And you will need to name it if there is some other arguments.
Anyway the point is you get to take advantage of the trailing lamda syntaxAndrey Kulikov
06/05/2019, 10:15 PMButton(action: {}) {
Text("Add room")
}
In Compose it is almost the same
Button(onClick = {}) {
Text("Add room")
}
voddan
06/06/2019, 8:39 AM