How to get visible IndexPath while scrolling in collectionView,I referred many link1,link2 But indexPathForCell is not suppor
visible IndexPath
scrolling
collectionView
indexPathForCell
This will work fine.
func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer) { let visibleIndex = Int(targetContentOffset.pointee.x / collectionView.frame.width) print(visibleIndex) }