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

Expose `cellForItem` API

kishancm opened this issue · comments

Currently I am using this repo for show and play video player in Cell and video is automatically play.
But problem is that when I am going to another tab video is still player on ExampleCell.I want to stop video player so how can I access cell outside CardForItemAt method and handle my issue ?

Thanks

@kishancm have you get any solution for this. I am so stuck with this . ?

@kishancm have you get any solution for this. I am so stuck with this . ?

@veersr9 Have you find any solution for stop video player in background ??

Hi, there is no direct API access for this provided yet but you can just use:

if let focussedCardIndex = cardSwiper.focussedCardIndex {
        let card = cardSwiper.verticalCardSwiperView.cellForItem(at: IndexPath(row: focussedCardIndex, section: 0))
        // Do something with the card
}

because VerticalCardSwiper is built on top of UICollectionView. I'll expose this as an API call in a future version.