VerticalCardSwiper icon indicating copy to clipboard operation
VerticalCardSwiper copied to clipboard

Expose `cellForItem` API

Open kishancm opened this issue 4 years ago • 4 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 avatar Jul 30 '20 12:07 kishancm

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

veersr9 avatar Aug 05 '20 11:08 veersr9

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

kishancm avatar Aug 06 '20 13:08 kishancm

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

kishancm avatar Aug 06 '20 13:08 kishancm

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.

JoniVR avatar Aug 06 '20 20:08 JoniVR