UPCarouselFlowLayout icon indicating copy to clipboard operation
UPCarouselFlowLayout copied to clipboard

How to get center index in collectionView?

Open reza-khalafi opened this issue 5 years ago • 1 comments

Hi.
I want to get center index in this collection view at default mode or after scroll.
How to get it? Screen Shot 2019-07-04 at 11 51 52 AM

reza-khalafi avatar Jul 04 '19 07:07 reza-khalafi

 func scrollViewDidScroll(_ scrollView: UIScrollView) {
     
            let centerPoint = CGPoint(x: collectionView.bounds.midX , y: collectionView.bounds.midY)

            if let indexPath = collectionView.indexPathForItem(at: centerPoint) {
//bla bla
            }
    }

mouness2020 avatar Aug 06 '19 12:08 mouness2020