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

Commit 00441e6

Browse files
author
grant
committed
Revert "ignore bounds change when setCurrentPage"
This reverts commit 073f3ce.
1 parent 073f3ce commit 00441e6

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Lib/CollectionViewPagingLayout.swift

Lines changed: 1 addition & 4 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
181178
updateCurrentPageIfNeeded(basedOn: contentOffset)
182179
}
183180
}

0 commit comments

Comments
 (0)