I know some people have asked this question before but they were all about UITableViews
or UIScrollViews
and I couldn't get the accepted solution to work for me. What I would like is the snapping effect when scrolling through my UICollectionView
horizontally - much like what happens in the iOS AppStore. iOS 9+ is my target build so please look at the UIKit changes before answering this.
Thanks.
For what it is worth here is a simple calculation that I use (in swift):
Call where you need it. I call it in
And
Where collectionViewFlowLayout could come from: