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

Disable scrolling

andynadheer opened this issue · comments

Is there a way to disable scrolling to the next card? For instance if tapped the first card, then you are allowed to scroll to next card. After you have scrolled to the second card, you have to tap that card to be able to scroll to third card, etc.

So you only want to allow user scrolling by tapping a card if I understand correctly?

If that is the case, you can do it like this:

override func viewDidLoad() {
    super.viewDidLoad()
	cardSwiper.verticalCardSwiperView.isScrollEnabled = false
}

// implement VerticalCardSwiperDelegate to use this function
func didTapCard(verticalCardSwiperView: VerticalCardSwiperView, index: Int) {
    cardSwiper.scrollToCard(at: index + 1, animated: true)
}

Yes thank you! 👍