I would prefer the former example yes. If it fits my line width, which is 80, then I'd use that style. The latter example is totally busted in terms of readability and proper code indentation.
So I would pick one the following styles:
Button(action: self.buttonTapped)
label: {
Text("My button")
}
.modifier()
// this one is strange though.
Button
.init(action: self.buttonTapped)
label: {
Text("My button")
}
.modifier()
Button
.init(action: self.buttonTapped) {
Text("My button")
}
.modifier()
// preferred because of the clarity provided
// by the labels
Button
.init(
action: self.buttonTapped,
label: {
Text("My button")
}
)
.modifier()