Been trying to use a ForEach loop to display the players cards from an array of data. When I add @State it resets to an empty array.
I’ve tried a bunch of different ways to write the code over the past three days. Been referencing other apps made with Chris and I can’t figure out what im doing wrong. Any input is helpful!
**I know the cards above are named differently, im using two sets of image data
Just to add to the suggestion from SwiftDevJournal above, when you copy and paste in your code block, select that block and tap on the Quotes you see in the menu bar above the editing window, ie, as per this screenshot.
Alternatively just type 3 back-ticks ``` on a new line then hit return and paste your code in and then on the next line after the code you have pasted in type the same 3 back-ticks
So it would be something like this
```
Your code goes here
```
The backticks will not show up since it’s a formatting directive.
The back-tick character is on the same key as the tilde character. It may be in a different position depending on UK or US keyboard layout.