Skip to content
This repository was archived by the owner on Jun 17, 2023. It is now read-only.

Commit 6a472c6

Browse files
author
grant
committed
Merge branch 'grant.zhou/github_multisections' into 'master'
Grant.zhou/github multisections See merge request grant/CollectionViewPagingLayout!4
2 parents 4c52be1 + 88f07d2 commit 6a472c6

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Lib/CollectionViewPagingLayout.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,9 @@ public class CollectionViewPagingLayout: UICollectionViewLayout {
6565

6666

6767
// MARK: UICollectionViewLayout
68-
var ignoreBoundsChange : Bool = false
6968

7069
override public func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool {
71-
!ignoreBoundsChange
70+
true
7271
}
7372

7473
override public func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
@@ -175,9 +174,7 @@ public class CollectionViewPagingLayout: UICollectionViewLayout {
175174
offset = max(0, offset)
176175
offset = min(offset, maxPossibleOffset)
177176
let contentOffset: CGPoint = scrollDirection == .horizontal ? CGPoint(x: offset, y: 0) : CGPoint(x: 0, y: offset)
178-
ignoreBoundsChange = true
179177
collectionView?.setContentOffset(contentOffset, animated: animated)
180-
ignoreBoundsChange = false
181-
updateCurrentPageIfNeeded(basedOn: contentOffset)
178+
//updateCurrentPageIfNeeded(basedOn: contentOffset)
182179
}
183180
}

0 commit comments

Comments
 (0)