File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ class GLIndexedCollectionViewFlowLayout: UICollectionViewFlowLayout {
3737 }
3838
3939 override func targetContentOffset( forProposedContentOffset proposedContentOffset: CGPoint , withScrollingVelocity velocity: CGPoint ) -> CGPoint {
40+ guard proposedContentOffset. x > 0 else {
41+ return CGPoint ( x: 0 , y: 0 )
42+ }
43+
4044 // If the UICollectionView has paginatedScroll set to false there is no
4145 // need to apply any pagination logic, we will return the current
4246 // proposedContentOffset coordinates.
@@ -112,7 +116,7 @@ class GLIndexedCollectionViewFlowLayout: UICollectionViewFlowLayout {
112116 offsetCorrection = cellLayoutAttribute. frame. origin. x - proposedXCoordWithInsets
113117 }
114118 }
115-
119+
116120 return CGPoint ( x: proposedContentOffset. x + offsetCorrection, y: 0 )
117121 }
118122}
You can’t perform that action at this time.
0 commit comments