Deck is a library that provides a UI to reproduce stacked cards for SwiftUI.
RPReplay_Final1624531727.mov
struct Card: View {
var data: Data
var body: some View {
Text(data.id)
}
}
struct SimpleExample: View {
@ObservedObject var deck: Deck = Deck(["😀","😃","😄","😆","😅","😂"].map { Data(id: "\($0)") })
var body: some View {
DeckStack(deck, option: .allowed(directions: [.left, .top, .right]) ) { data, targetID in
Card(data: data)
}
}
}