Created
February 16, 2022 12:42
-
-
Save ChrisMash/27b501ecec57d1970928b0221dc27eb7 to your computer and use it in GitHub Desktop.
Snapshot of HandView from https://github.com/ChrisMash/SwiftUI-Playing-Cards for my blog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A view to represent the cards in a hand | |
struct HandView: View { | |
@ObservedObject var hand: Hand | |
let namespace: Namespace.ID | |
let onCardTap: (Card) -> Void | |
var body: some View { | |
HStack { | |
ForEach(hand.cards) { card in | |
CardView(card: card, namespace: namespace) | |
.onTapGesture { | |
onCardTap(card) | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment