Skip to content

Instantly share code, notes, and snippets.

@factoryhr
Last active January 28, 2020 07:21
Show Gist options
  • Save factoryhr/a4ad50d701c5572e4adda55f094093e2 to your computer and use it in GitHub Desktop.
Save factoryhr/a4ad50d701c5572e4adda55f094093e2 to your computer and use it in GitHub Desktop.
override func invalidateLayout(with context: UICollectionViewLayoutInvalidationContext) {
let invalidationContext = context as! CustomLayoutInvalidationContext
if invalidationContext.invalidatedBecauseOfBoundsChange || invalidationContext.invalidateEverything {
layoutAttributesForItems.removeAll()
}
super.invalidateLayout(with: invalidationContext)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment