Skip to content
New issue

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

How to get center index in collectionView? #55

Open
reza-khalafi opened this issue Jul 4, 2019 · 1 comment
Open

How to get center index in collectionView? #55

reza-khalafi opened this issue Jul 4, 2019 · 1 comment

Comments

@reza-khalafi
Copy link

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

@mouness2020
Copy link

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants