I'm facing an error says "cannot assign to property" as seen in the preview image.
I get this error when I use the variable inside the struct of View and inside the forEach.
Here's Screenshot.
Define you currentMood as a @State variable:
currentMood
@State
@State var currentMood: String
You'll likely need to assign it with self.currentMood = moodData (adding self.)
self.currentMood = moodData
self.