|
Imagine a card board. All cards are on a view I call CardBoard. All cards are on an array:
Every card has its own position. This is Card
Now I want to draw them on the screen.
when I try this, Xcode tells me
when I add
if position was not @State, I would simply add this to fix the problem
but this will not work for point as a @State... any ideas? |
|
It's because of the You should only use the |
|
Thanks for the answer I did what you said and the problem is solved. I am not sure if I understand correcly when an object must be hashable. |
|
So
But sometimes conforming to Instead, you can use this form of
and for the You don't have to use Make sense? |
|
Ah, the fact of it being hashable eases that task because if it has to compare every letter of each string, character by character it would take longer than previously hasing the strings and compare the hash? Interesting. |
SAVE 50% All our books and bundles are half price for Black Friday, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.