Closed Bertges closed 6 years ago
Solved my problem by getting the indexPath of the center colectionView cell.
func scrollViewDidScroll(_ scrollView: UIScrollView) {
let center = CGPoint(x: scrollView.contentOffset.x + (scrollView.frame.width / 2), y: (scrollView.frame.height / 2))
if let ip = self.collectionView!.indexPathForItem(at: center) {
self.pageControl.currentPage = ip.row
}
}
Hi, I'm facing the same problem specified in this issue:
https://github.com/ink-spot/UPCarouselFlowLayout/issues/23
In his case, he's using another framework, but I want to keep using UPCarouselFlowLayout.
There is an easy way to get the current page?