JoniVR / VerticalCardSwiper

A marriage between the Shazam Discover UI and Tinder, built with UICollectionView in Swift.
MIT License
1.39k stars 100 forks source link

Stop Left Swipe || Increase Card Size #72

Closed veersr9 closed 3 years ago

veersr9 commented 4 years ago

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.

JoniVR commented 4 years ago

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.