JoniVR / VerticalCardSwiper

A marriage between the Shazam Discover UI and Tinder, built with UICollectionView in Swift.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stop Left Swipe || Increase Card Size

veersr9 opened this issue · comments

How do I stop only left swipe. If I am doing this ->

func willSwipeCardAway(card: CardCell, index: Int, swipeDirection: SwipeDirection) {

    switch swipeDirection{
    case SwipeDirection.Right:
        if index < arrayHome.count {
            arrayHome.remove(at: index)
        }
    default:
        print("do nothing because be we didn't drag left")
    }
}

-> But this is freezing the screen . And How can I increase card size.

I don't think there's a way to block a swipe to either side as of yet. What exactly are you looking for? Should the card just animate back or not move in that direction at all?

As for increasing the card size, you can use sizeForItem or change the topInset and sideInset properties.