It depends on the UI.
Is perfectly fine to mix them, having a sum(data class) with mutually exclusive(sealed class) mixed is fine.
The UI dictates. I normally use sealed class when the component layout changes drastically between states. Eg: from a CardView to a Loader.
Yeah, computing it in CardView would have caused a bunch of unneeded updates because it would have made every CardView still dependent on the full game state
@squeakytoy any reason to compute the isFlipped value in the GameViewObservable View instead of within the CardView View?
It seems the CardView has everything to do it directly (card object index).
Fix this one simple issue @thekitze said ...
and my stupid brain said : while we're at it, let's also break down the cardView file into subcomponents...
Which messed up ALL views now as they're calculated differently.
2 hours later we're back at 1 😂
I used your CardView back in Xamarin days. Now I use the built-in one for most apps. I just keep it simple and don't push the control beyond what it's capable of.
Day 88 of the #100DaysOfSwiftUI
FlashZilla: Project 17 - Day 3
FlashZilla is an iOS app that helps you learn new things using flashcards.
added:
- Designed a new CardView
- Built stack of cards
- card drag (left or right) animation to remove using DragGesture & offset()