DeckKit is a SwiftUI SDK that helps you build deck-based apps.
DeckKit has a DeckView
component that can render any DeckItem
collection, with support for swipe gestures, edge swipes, shuffling, etc. The result can look like this, or completely different:
DeckKit can be customized to great extent. You can change colors, fonts, etc. and use completely custom views. It also has tools to manage favorites.
DeckKit can be installed with the Swift Package Manager:
https://github.com/danielsaidi/DeckKit.git
With DeckKit, you can create a Deck
of any model that conform to DeckItem
:
struct Hobby: DeckItem {
var name: String
var text: String
var id: String { name }
}
You can display a deck of cards with any of the built-in views, like a DeckView
:
struct MyView: View {
@State
var hobbies: [Hobby] = ...
var body: some View {
DeckView($hobbies) { hobby in
RoundedRectangle(cornerRadius: 25.0)
.fill(.blue)
.overlay(Text(hobby.name))
.shadow(radius: 10)
}
}
}
See the online getting started guide for more information.
The online documentation has more information, articles, code examples, etc.
The Demo
folder has an app that lets you test the library on iOS, macOS, and visionOS.
You can sponsor me on GitHub Sponsors or reach out for paid support, to help support my open-source projects.
Your support makes it possible for me to put more work into these projects and make them the best they can be.
Feel free to reach out if you have questions or if you want to contribute in any way:
- Website: danielsaidi.com
- Mastodon: @[email protected]
- Twitter: @danielsaidi
- E-mail: [email protected]
DeckKit is available under the MIT license. See the LICENSE file for more info.