SwiftUI display different images/text on toggle/true or false – Ios swift
I'm trying to create a button that displays a different images/text depending on the current state of a task. I've found the following doesn't work: Button { taskViewModel.completeTask(id: task.id) } label: { if task.taskCompleted { Image(systemName: "square") .foregroundStyle(.black) .padding(10) .background(Color(.white),…