Skip to content

inloop/ParallaxAnimation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ParallaxAnimation

Simple parallax example for Horizontal and Vertical direction using UICollectionViewLayout modification.

Parallax animation

override class var layoutAttributesClass: AnyClass {
        get {
            return ParallaxLayoutAttributes.classForCoder()
        }
}

override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool {
        return true
}

By overriding var and method like above the developer is able to implement these delegate methods and mofify the collectionViewCell however he wants.

override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]?

override func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes?

override func apply(_ layoutAttributes: UICollectionViewLayoutAttributes)

Requirements

  • iOS 9.0+
  • Xcode 8.0+
  • Swift 3.0+

Author

MartinPrusa, martin.prusa@inloop.eu

License

ParallaxAnimation is available under the MIT license. See the LICENSE file for more info.

About

iOS UICollectionView layout parallax effect example

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages