MXCardsSwipingView 0.2.0

MXCardsSwipingView 0.2.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Oct 2016

Maintained by Scott Kensell.



  • By
  • Scott Kensell

A lightweight solution for introducing swipable cards like Tinder or AngelList. Just a few hundred lines of code.

Preview

Swiping example Swiping example

Usage

#import <MXCardsSwipingView/MXCardsSwipingView.h>

Create an MXCardsSwipingView and add it to your view hierarchy. Add cards to it with enqueueCard:. Each card added is immediately added to the view heirarchy behind the previously enqueued cards. When a card is dismissed you can enqueue more during the delegate callback

- (void)cardsSwipingView:(MXCardsSwipingView*)cardsSwipingView willDismissCard:(UIView*)card toLeft:(BOOL)toLeft;

A card can be any UIView, but you can get more customizability by adopting the MXSwipableCard protocol (e.g. to fade in a certain subview of the card depending on the swipe direction).

The example project (which is featured in the above gifs) shows how to add a drop shadow to a card with corner radius as well as how to add differing transforms to background cards as opposed to the top card.

Whatever size you enqueue a card with, it stays that size. Only the center of the card will be readjusted and managed by MXCardsSwipingView.

Check out MXCardsSwipingView.h for full API.

Development

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Deployment target of at least iOS 7.0.

Installation

MXCardsSwipingView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "MXCardsSwipingView"

Author

Scott Kensell, [email protected]

License

MXCardsSwipingView is available under the MIT license. See the LICENSE file for more info.