All Projects → D-32 → Dmswipecards

D-32 / Dmswipecards

Licence: mit
🃏 Tinder like card interface

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Dmswipecards

Web Client
Generic Linked Data browser and UX component framework. Apache license.
Stars: ✭ 105 (-56.97%)
Mutual labels:  generic
Focal Frequency Loss
Focal Frequency Loss for Generative Models
Stars: ✭ 141 (-42.21%)
Mutual labels:  generic
Mongodb Generic Repository
An example of generic repository implementation using the MongoDB C# Sharp 2.0 driver (async)
Stars: ✭ 185 (-24.18%)
Mutual labels:  generic
Hearthstone Db
A JSON collection of all Hearthstone cards. Hearthstone database.
Stars: ✭ 117 (-52.05%)
Mutual labels:  cards
Reusablekit
Generic reusables for UICollectionView and UITableView
Stars: ✭ 130 (-46.72%)
Mutual labels:  generic
Niui
Lightweight, feature-rich, accessible front-end library
Stars: ✭ 152 (-37.7%)
Mutual labels:  cards
Contacts
A flutter project with Implementation of a Contacts app in 4 ways (API, Custom, Preferences and Sqflite).
Stars: ✭ 100 (-59.02%)
Mutual labels:  cards
Zlayoutmanager
Some custom LayoutManager .Such as SwipeCard、FLowLayout。一些自定义的LayoutManager,仿探探、人人影视 炫动滑动 卡片层叠 和流式布局等。
Stars: ✭ 2,404 (+885.25%)
Mutual labels:  cards
Swipeablecards
Stars: ✭ 136 (-44.26%)
Mutual labels:  cards
React Native Card Flip
Card flip animation for React Native
Stars: ✭ 183 (-25%)
Mutual labels:  cards
Glabels Qt
gLabels Label Designer (Qt/C++)
Stars: ✭ 116 (-52.46%)
Mutual labels:  cards
Genericdatasource
A generic small reusable components for data source implementation for UITableView/UICollectionView in Swift.
Stars: ✭ 127 (-47.95%)
Mutual labels:  generic
Eval
Eval is a lightweight interpreter framework written in Swift, evaluating expressions at runtime
Stars: ✭ 157 (-35.66%)
Mutual labels:  generic
Flutter Adaptivecards
AdaptiveCards for Flutter 🐦
Stars: ✭ 117 (-52.05%)
Mutual labels:  cards
React Tiny Link
Convert your links into rich previews
Stars: ✭ 193 (-20.9%)
Mutual labels:  cards
Scroll
Scroll - making scrolling through buffers fun since 2016
Stars: ✭ 100 (-59.02%)
Mutual labels:  generic
Uicard
Generic UI for card games like Hearthstone, Magic Arena and Slay the Spire...
Stars: ✭ 142 (-41.8%)
Mutual labels:  cards
Lwrb
Lightweight generic ring buffer manager library
Stars: ✭ 215 (-11.89%)
Mutual labels:  generic
Cardparts
A reactive, card-based UI framework built on UIKit for iOS developers.
Stars: ✭ 2,374 (+872.95%)
Mutual labels:  cards
Sc
Common libraries and data structures for C.
Stars: ✭ 161 (-34.02%)
Mutual labels:  generic

Version License twitter: @dylan36032

image

Features

  • Swift 3
  • Custom views for the card & overlay
  • Generic
  • Dynamically add new cards on top or on the bottom
  • Lazy view loading

Setup

pod 'DMSwipeCards'

Usage

First import the module:

import DMSwipeCards

Next create an instance of a DMSwipeCardsView:
(Element can be your custom model, or just String)

let swipeView = DMSwipeCardsView<Element>(frame: frame,
                                          viewGenerator: viewGenerator,
                                          overlayGenerator: overlayGenerator)

Views get loaded lazy, so you have to provide DMSwipeCardsView with a ViewGenerator and optionally an OverlayGenerator.

let viewGenerator: (String, CGRect) -> (UIView) = { (element: Element, frame: CGRect) -> (UIView) in
  // return a UIView here
}

let overlayGenerator: (SwipeMode, CGRect) -> (UIView) = { (mode: SwipeMode, frame: CGRect) -> (UIView) in
  // return a UIView here
}

Adding cards

To add new cards, just call the addCards method with an array of the previously defined Element:

swipeView.addCards([Element], onTop: true)

Delegate

DMSwipeCardsView has a delegate property so you can get informed when a card has been swipped. The delegate has to implement following methods:

func swipedLeft(_ object: Any)
func swipedRight(_ object: Any)
func cardTapped(_ object: Any)
func reachedEndOfStack()

The object parameter is guarenteed to have the type Element. Sadly generics don't work here.

Example

For a nice working demo sample, please take a look the Example project.
To run the example, first run pod install in the Example directory.

Credits

Loosly based on TinderSimpleSwipeCards

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].