Commit 25968533 authored by Toby Brennan's avatar Toby Brennan
Browse files

Minor code change

parent 1dbdb711
Showing with 11 additions and 8 deletions
+11 -8
......@@ -836,14 +836,17 @@ public struct ASCollectionView<SectionID: Hashable>: UIViewControllerRepresentab
var lastContentSize: CGSize = .zero
func didUpdateContentSize(_ size: CGSize)
{
guard let cv = collectionViewController?.collectionView, cv.contentSize != lastContentSize, cv.contentSize.width != 0, cv.contentSize.height != 0 else { return }
let firstSize = lastContentSize == .zero
lastContentSize = cv.contentSize
parent.contentSizeTracker?.contentSize = size
DispatchQueue.main.async {
self.parent.invalidateParentCellLayout?(!firstSize)
}
guard let cv = collectionViewController?.collectionView, cv.contentSize.width != .zero, cv.contentSize.height != .zero else { return }
if cv.contentSize != lastContentSize {
let firstSize = lastContentSize == .zero
lastContentSize = cv.contentSize
parent.contentSizeTracker?.contentSize = size
DispatchQueue.main.async {
self.parent.invalidateParentCellLayout?(!firstSize)
}
}
}
// MARK: Variables used for the custom prefetching implementation
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment