I have a button that I want to be an image that can change colors as needed (loading async). To do this, I thought I could do something like this: I thought I could do something like this:
Button(action: { doAction }) {
AsyncImage(url: URL(string: "test.com")) { image in
image
.resizable()
.aspectRatio(contentMode: .fit)
.renderingMode(.template)
}
}
However, when I try to do this, I get a few errors:
"Cannot infer return type for closure with multiple statements"
"Closure containing control flow statement cannot be used with result builder 'TableRowBuilder' "
I'm not sure why these errors show up only when I add the "renderingMode" modifier. Everything works other than adding that. Any idea what I'm doing wrong?