Swipe able, customizable card stack view, Tinder like card stack view based on UICollectionView. Cards UI

Related tags

Cards indy
Overview

Swipable, customizable card stack view, Tinder like card stack view based on UICollectionView. Cards UI

Swipable, customizable card stack view, Tinder like card stack view based on UICollectionView

Сocoapods installation

Add in your Podfile:

pod 'TisprCardStack'

please pay attention:

  • 2.x.x versions with swift 4.0
  • 1.x.x versions with swift 3.0

And in your *.swift:

import TisprCardStack

Manual installation

Add TisprCardStackViewCell.swift,TisprCardStackViewController.swift, TisprCardStackViewLayout.swift into your Xcode project.

Usage start

  1. Create controller 'TisprCardStackViewController' with 'TisprCardStackViewLayout' collectionViewLayout

  2. Configuration TisprCardStackViewController,

      setAnimationSpeed(0.85)
      setCardSize(size)
  1. then specify count of cards,
func numberOfCards() -> Int {}
  1. return cards by index:
card(collectionView: UICollectionView, cardForItemAtIndexPath indexPath: NSIndexPath) -> TisprCardStackViewCell {}

Additional features/options

  1. Adding a new card: How to call the animation:
func newCardWasAdded()
  1. How to configure the amount of visible cards in each stack (top and bottom):
      layout.topStackMaximumSize = 4
      layout.bottomStackMaximumSize = 30
      layout.bottomStackCardHeight = 45
  1. Changing card position: How to call the movement of a card from the top to the bottom stack and vice versa:
      moveCardUp()
      moveCardDown()
  1. Delete card:
  	deleteCard
  1. You can track changing of card stack in method:
  func cardDidChangeState(cardIndex: Int)

For more detail, see the sample project.

Contact owner

Indy

License

Apache License Version 2.0. See LICENSE.txt

Comments
  • Crash when drag card

    Crash when drag card

    Hello, When I keep dragging the card here and there without moving it down, app crash in this line collectionView?.bringSubview(toFront: cell!)

    in this method

    //Define what card should we drag
        fileprivate func findDraggingCellByCoordinate(_ touchCoordinate: CGPoint) {
            if let indexPath = collectionView?.indexPathForItem(at: touchCoordinate) {
                if indexPath.item >= index {
                    //top stack
                    draggedCellPath = IndexPath(item: index, section: 0)
                    initialCellCenter = collectionView?.cellForItem(at: draggedCellPath!)?.center
                } else {
                    //bottomStack
                    if (index > 0 ) {
                        draggedCellPath = IndexPath(item: index - 1, section: 0)
                    }
                    initialCellCenter = collectionView?.cellForItem(at: draggedCellPath!)?.center
                }
                
                //workaround for fix issue with zIndex
                let cell = collectionView!.cellForItem(at: draggedCellPath!)
                collectionView?.bringSubview(toFront: cell!)
                
            }
        }
    

    How to overcome this issue. Please help me.

    opened by RoshaniDias 4
  • Swipe Gestures on iOS9 / Swift 2

    Swipe Gestures on iOS9 / Swift 2

    I've had to disable the swipe gestures as I've found them not to redraw the card stack properly. For example, swiping down a card can result in it disappearing. If I then drag up the 'invisible' card it suddenly appears.

    I'm not having any problems with the Pan gesture.

    bug 
    opened by morgz 3
  • Swipe Card in single Direction

    Swipe Card in single Direction

    i need swipe Card in down direction only. How can i achieve that? Also it is crashing when swipe up direction: error: fatal error: Can't form Range with upperBound < lowerBound

    opened by Abhishek-NickelFox 2
  • Multiple stacks of cells in a collectionView

    Multiple stacks of cells in a collectionView

    Hey!

    Currently is there anyway to create multiple stacks of cards? I know it creates one stack at default but I need multiple stacks in my TisprCardStackViewController.

    Is this supported? Thanks!

    Ethan

    opened by ethan021021 2
  • Add Card in Front and remove after down

    Add Card in Front and remove after down

    Dear, congrats for your beautiful work! i have a question, is it possible to add new card in front of the current one and not on the bottom?

    another question, is it possibile do have a func do delete a card after down effect? something like

    func cardDidChangeState(cardIndex: Int) {
            removeFromStack(cardIndex)
    }
    
    thanks!
    
    opened by lucabecchetti 2
  • App crash

    App crash

    Example app crashes with error dyld: Library not loaded: @rpath/TisprCardStack.framework/TisprCardStack Referenced from: /var/containers/Bundle/Application/72BAA679-CBD0-494A-ADC4-5A59F5FC81AF/TisprCardStackExample.app/TisprCardStackExample Reason: image not found

    I am still a newbie with swift. Any workaround for this and get the demo app running?

    opened by pushkardeshmukh1992 1
  • Remove Card from the stack

    Remove Card from the stack

    I want to do a delete function with this. Can you guide me how to do that. I did reloading the view after remove an object from the stack but it's crashing for me.

    After I go to the next view and perform the delete action. then when come back my stack should be refreshed. In viewdidappear() I did this `

      if(dm.cardshouldRefresh || isFirsttimeLoad)
        {
            
            com.showProgress()
            
            self.getAuthorizations() { (status) in
                
                self.dm.cardshouldRefresh=false
                self.isFirsttimeLoad=false
                self.com.removeProgress()
                if (status)
                {
                    self.setupCardView()
    
                }
    
            }
        }
        
        else
        {
            print(arrayAuthorization)
            
        }   
    }
    
    func makecollectionViewEmpty()
    {
        arrayAuthorization.removeAll()
        vwBtnPanelBottom.removeFromSuperview()
        self.collectionView?.reloadData()
    }
    

    `

    opened by RoshaniDias 1
  • waring install with cocoa pods

    waring install with cocoa pods

    hi when i install code : pod 'TisprCardStack', '~> 0.3.1'

    warning :

    [!] Unable to read the license file `/Users/Javad/Desktop/balen/Pods/TisprCardStack/LICENSE.txt` for the spec `TisprCardStack (0.3.1)`
    
    [!] Unable to read the license file `/Users/Javad/Desktop/balen/Pods/TisprCardStack/LICENSE.txt` for the spec `TisprCardStack (0.3.1)`
    

    can you help me ? Thanks a lot

    opened by J-Arji 1
  • Crash on [UICollectionViewController loadView]

    Crash on [UICollectionViewController loadView]

    Using build:

    pod 'TisprCardStack', '~> 0.2.0beta1'
    

    Crashes with this error:

    '-[UICollectionViewController loadView] loaded the "zvq-Xi-k6K-view-Ul4-59-zee" nib but didn't get a UICollectionView.'
    

    Copied code from example project pretty much verbatim: (Storyboard contains proper UICollectionView and cell with correct identifier, datasource/delegate assignment, etc.)

    override func viewDidLoad() {
        super.viewDidLoad()
    
        //set animation speed
        setAnimationSpeed(0.85)
    
        //set size of cards
        let size = CGSizeMake(view.bounds.width - 40, 2*view.bounds.height/3)
        setCardSize(size)
    
        cardStackDelegate = self
    
        //configuration of stacks
        layout.topStackMaximumSize = 4
        layout.bottomStackMaximumSize = 30
        layout.bottomStackCardHeight = 45
    }
    
    // MARK: TisprCardStackDataSource
    override func numberOfCards() -> Int {
        return 10
    }
    
    override func card(collectionView: UICollectionView, cardForItemAtIndexPath indexPath: NSIndexPath) -> TisprCardStackViewCell {
    
        let cell = collectionView.dequeueReusableCellWithReuseIdentifier("CellIdentifier", forIndexPath: indexPath) as! TisprCardStackDemoViewCell
    
        cell.backgroundColor = UIColor.purpleColor()
        //cell.text.text = "Card - \(indexPath.item)"
    
        return cell
    
    }
    
    // MARK: TisprCardStackDelegate
    func cardDidChangeState(cardIndex: Int) {
        print("card with index - \(cardIndex) changed position")
    }
    
    opened by Appmazo 1
  • Could not cast value of type 'UICollectionViewFlowLayout' to 'Swish.TisprCardStackViewLayout'

    Could not cast value of type 'UICollectionViewFlowLayout' to 'Swish.TisprCardStackViewLayout'

    The error Could not cast value of type 'UICollectionViewFlowLayout' to 'Swish.TisprCardStackViewLayout' appears each time I try and build this. I just dropped the three files into my project. Any ideas anyone?

    opened by briannadoubt 1
  • Update licensing information in source code files

    Update licensing information in source code files

    Instead of what is there now we need to have this:

       Copyright 2015 BuddyHopp, Inc.
    
       Licensed under the Apache License, Version 2.0 (the "License");
       you may not use this file except in compliance with the License.
       You may obtain a copy of the License at
    
           http://www.apache.org/licenses/LICENSE-2.0
    
       Unless required by applicable law or agreed to in writing, software
       distributed under the License is distributed on an "AS IS" BASIS,
       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       See the License for the specific language governing permissions and
       limitations under the License.
    
    opened by voitau 1
  • Added Delegates for Card Movement

    Added Delegates for Card Movement

    Added delegates for card bottom and card top movements. Further update the swift to reflect latest swift changes.

    Signed-off-by: hjafri256 [email protected]

    opened by ghazi256 0
  • Added Support for neighbourly app(by Google) like Card View

    Added Support for neighbourly app(by Google) like Card View

    Hi, I have integrated your as well as new neighbourly app(by Google) like card view in this pull request. Please take a look and revert.

    Regards, Nakash Jawahire

    opened by njawahire 0
  • Horizontal View Enhancement

    Horizontal View Enhancement

    Hi, I have made changes in this code to make it horizontal scrolling with slight variation(similar to neighbourly app by google). For reference checkout my fork: https://github.com/njawahire/tispr-card-stack

    opened by njawahire 0
Releases(3.0.0)
Owner
Indy
Indy Engineering Team
Indy
A easy-to-use SwiftUI view for Tinder like cards on iOS, macOS & watchOS.

?? CardStack A easy-to-use SwiftUI view for Tinder like cards on iOS, macOS & watchOS. Installation Xcode 11 & Swift Package Manager Use the package r

Deniz Adalar 285 Jan 3, 2023
KolodaView is a class designed to simplify the implementation of Tinder like cards on iOS.

KolodaView Check this article on our blog. Purpose KolodaView is a class designed to simplify the implementation of Tinder like cards on iOS. It adds

Yalantis 5.2k Jan 2, 2023
🃏 Tinder like card interface

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 'DMSwipeCar

Dylan Marriott 250 Nov 15, 2022
A marriage between the Shazam Discover UI and Tinder, built with UICollectionView in Swift.

VerticalCardSwiper A marriage between the Shazam Discover UI and Tinder, built with UICollectionView in Swift. Project goal and information The goal o

Joni Van Roost 1.2k Dec 28, 2022
🃏 Cardslider is a design UI controller that allows you to swipe through cards with pictures and accompanying descriptions.

CARD SLIDER UI controller that allows you to swipe through cards with pictures. We specialize in the designing and coding of custom UI for Mobile Apps

Ramotion 1.2k Dec 19, 2022
Card-based view controller for apps that display content cards with accompanying maps, similar to Apple Maps.

TripGo Card View Controller This is a repo for providing the card-based design for TripGo as well as the TripKitUI SDK by SkedGo. Specs 1. Basic funct

SkedGo 6 Oct 15, 2022
A navigation controller that displays its view controllers as an interactive stack of cards.

CardNavigation The easiest way to turn a navigation controller into an interactive stack of cards. Highlights ✅ Fully interactive and interruptible ✅

James Randolph 41 Sep 29, 2022
🔥 A multi-directional card swiping library inspired by Tinder

Made with ❤️ by Mac Gallagher Features ?? Advanced swipe recognition based on velocity and card position ?? Manual and programmatic actions ?? Smooth

Mac Gallagher 754 Dec 28, 2022
This UI attempts to capture the Quibi Card Stack and the associated User Interaction.

RGStack This UI attempts to capture the Quibi Card Stack and the associated User Interaction. Required A View that conforms to the ConfigurableCard pr

RGeleta 96 Dec 18, 2022
A SwiftUI view that arranges its children in a whimsical interactive deck of cards, as seen in Big News

CardStack A SwiftUI view that arranges its children in a whimsical interactive deck of cards. CardStack mimics the behaviour of the photo stack in iMe

The Not So Big Company 74 Dec 13, 2022
IOS Card Game - A simple card game using SwiftUI

IOS_Card_Game A simple card game using Swift UI.

Md. Masum Musfique 1 Mar 25, 2022
A swift SDK to help you scan debit/credit cards.

SKCardReader A swift SDK to help you scan debit/credit cards. Requirements To use the SDK the following requirements must be met: Xcode 11.0 or newer

Syed Kashan 4 Jul 29, 2022
Swift Package to download Transactions for LunchOnUs Cards

LunchOnUs Downloader What This is a small library to download transaction and balance data for LunchOnUs Cards (Giftcards by Eigen Development). How C

Steffen Kötte 0 Jan 15, 2022
Presenting timelines as cards, single or bundled in scrollable feed!

TimelineCards ?? Autogenerated timelines presented as cards ?? ?? Single or bundled into feed ?? Installation CocoaPods (wtf is that?) Add pod 'Timeli

0xNSHuman 428 Dec 16, 2022
Awesome iOS 11 appstore cards in swift 5.

Cards brings to Xcode the card views seen in the new iOS XI Appstore. Getting Started Storyboard Go to main.storyboard and add a blank UIView Open the

Paolo Cuscela 4.1k Dec 14, 2022
Recreation of cards from Apple's AppStore written using SwiftUI.

App Store Cards Animation I tried to reproduce the look and the feeling of the cards from the AppStore. Please note that this repository is a work-in-

Roman 3 Mar 30, 2022
Presenting timelines as cards, single or bundled in scrollable feed!

TimelineCards ?? Autogenerated timelines presented as cards ?? ?? Single or bundled into feed ?? Installation CocoaPods (wtf is that?) Add pod 'Timeli

0xNSHuman 428 Dec 16, 2022
Awesome looking Dial like card selection ViewController

KVCardSelectionVC Awesome looking Dial like card selection ViewController An updated Swift 3 working version of : https://github.com/atljeremy/JFCardS

Kunal Verma 23 Feb 1, 2021
A reactive, card-based UI framework built on UIKit for iOS developers.

CardParts - made with ❤️ by Intuit: Example Requirements Installation Communication & Contribution Overview Quick Start Architecture CardsViewControll

Intuit 2.5k Jan 4, 2023