Created
July 1, 2021 08:34
-
-
Save yccheok/568e325bb6f4bacda5dc91ae30e87f7e to your computer and use it in GitHub Desktop.
Flow layout without animation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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