JoniVR / VerticalCardSwiper

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

Expose `cellForItem` API #71

Open kishancm opened 4 years ago

kishancm commented 4 years ago

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

veersr9 commented 4 years ago

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

kishancm commented 4 years ago

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

kishancm commented 4 years ago

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

JoniVR commented 4 years ago

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.