Skip to content

Instantly share code, notes, and snippets.

@ChrisMash
Last active February 16, 2022 12:25
Show Gist options
  • Save ChrisMash/ef82578b7191a5b50df23d47af7b19a5 to your computer and use it in GitHub Desktop.
Save ChrisMash/ef82578b7191a5b50df23d47af7b19a5 to your computer and use it in GitHub Desktop.
Snapshot of models from https://github.com/ChrisMash/SwiftUI-Playing-Cards for my blog
// A representation of a playing card
struct Card: Identifiable, Equatable {
let id = UUID()
let number: Int
}
// A representation of a player's hand of cards
class Hand: ObservableObject, Identifiable {
let id = UUID()
@Published var cards = [Card]()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment