Hi,
In the 14 day challenge on Lesson 11 - State Properties, we begin to learn how to update the views of properties using @State. I see we added 4 @State properties to the top of our view struct because those are variable we want to update the view of.
But what if we wanted to create a new Class called Card, with a struct inside called Card, and when we add cards to the screen, we simply add a new instance of the card? I got the instance working, so when I start my app a random card is selected for the player and the cpu, but how would I update the instances/properties of these cards at runtime and update changes of the cards?
I strongly feel like creating reusable code here is smart by going with a Card Class and I feel that the lesson could have added value and reinforcement in instances by showing us this. Any experts care to chime in and help?
Thank you