Post

Replies

Boosts

Views

Activity

Reply to Cannot convert value of type '() -> ()' to expected argument type 'String' SwiftUI Button
@sha921 @thibautrichez Thank you for your responses. I get the following errors with the code below: Button { login() } label: { ZStack { RoundedRectangle(cornerRadius: 5) .fill(Color.black) .frame(width: UIScreen.main.bounds.width - 50, height: 50) Text("Sign in") .foregroundColor(.white) } } func login() { print("test") } Incorrect argument label in call (have '_: label:', expected 'value:selected:') Trailing closure passed to parameter of type 'String' that does not accept a closure Thank you again for the help so far.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’23