Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/1amageek/deck
Deck is a library that provides a UI to reproduce stacked cards for SwiftUI.
https://github.com/1amageek/deck
ios swift swiftui
Last synced: 22 days ago
JSON representation
Deck is a library that provides a UI to reproduce stacked cards for SwiftUI.
- Host: GitHub
- URL: https://github.com/1amageek/deck
- Owner: 1amageek
- Created: 2021-06-12T13:58:43.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-07-02T08:16:04.000Z (over 3 years ago)
- Last Synced: 2024-11-24T16:42:48.300Z (about 2 months ago)
- Topics: ios, swift, swiftui
- Language: Swift
- Homepage:
- Size: 48.8 KB
- Stars: 25
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Deck
Deck is a library that provides a UI to reproduce stacked cards for SwiftUI.
https://user-images.githubusercontent.com/11146538/123250840-7e09a680-d525-11eb-94e6-19fe96272ec6.mov
## Usage
```swift
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)
}
}
}```