Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@yccheok
Created July 1, 2021 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yccheok/568e325bb6f4bacda5dc91ae30e87f7e to your computer and use it in GitHub Desktop.
Save yccheok/568e325bb6f4bacda5dc91ae30e87f7e to your computer and use it in GitHub Desktop.
Flow layout without animation
class NoFadeFlowLayout: UICollectionViewFlowLayout {
override func initialLayoutAttributesForAppearingItem(at itemIndexPath: IndexPath) -> UICollectionViewLayoutAttributes? {
let attrs = super.initialLayoutAttributesForAppearingItem(at: itemIndexPath)
attrs?.alpha = 1.0
return attrs
}
override func finalLayoutAttributesForDisappearingItem(at itemIndexPath: IndexPath) -> UICollectionViewLayoutAttributes? {
let attrs = super.finalLayoutAttributesForDisappearingItem(at: itemIndexPath)
attrs?.alpha = 1.0
return attrs
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment