We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am customizing the frame size then the value of current page is getting wrong.
The text was updated successfully, but these errors were encountered:
This worked for me
// UIScrollView Delegate func scrollViewDidScroll(_ scrollView: UIScrollView) { // https://stackoverflow.com/a/38312063/ let centerPoint = CGPoint(x: scrollView.contentOffset.x + (scrollView.frame.width / 2), y: (scrollView.frame.height / 2)); guard let indexPath = collectionView.indexPathForItem(at: centerPoint) else { return; } print("page - \(indexPath.row)"); }
Here's the stack overflow post.
Sorry, something went wrong.
extension UICollectionView { func getCurrentIndex() ->IndexPath? { let centerPoint = CGPoint(x: self.contentOffset.x + (self.frame.width / 2), y: (self.frame.height / 2)); return self.indexPathForItem(at: centerPoint) } }
No branches or pull requests
I am customizing the frame size then the value of current page is getting wrong.
The text was updated successfully, but these errors were encountered: