I'm trying to make it so that when I click a button (that is part of a list of other buttons), the image for the clicked button changes from "star" to "star.fill". Please help!
ForEach(pies, id: \.self) { pie in
Button(action: {
// some action
}) {
HStack {
Image(systemName: "star")
Text(pie)
Spacer()
}
}