|
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. |
SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until February 9th.
Sponsor Hacking with Swift and reach the world's largest Swift community!
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.