FSPagerView
FSPagerView copied to clipboard
How can I disable automatic sliding
Hi, I am using this slider in collectionView cell. So when I scroll to slidercell is not visible I want to stop it and when it display it will continue to automatic sliding.
When i use it with like :
func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "HomeSliderViewCell", for: indexPath) as! HomeSliderViewCell cell.startSliding() }
func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "HomeSliderViewCell", for: indexPath) as! HomeSliderViewCell cell.stopSliding() }
and
func stopSliding() { pagerView.automaticSlidingInterval = 0 }
func startSliding() { pagerView.automaticSlidingInterval = 2 }
it will be coming back to 0 index of element to slide. How can I fix this ?