https://github.com/inloop/parallaxanimation
iOS UICollectionView layout parallax effect example
https://github.com/inloop/parallaxanimation
Last synced: about 2 months ago
JSON representation
iOS UICollectionView layout parallax effect example
- Host: GitHub
- URL: https://github.com/inloop/parallaxanimation
- Owner: inloop
- License: mit
- Created: 2016-09-27T12:15:39.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-05T12:12:46.000Z (over 9 years ago)
- Last Synced: 2024-12-29T05:26:17.727Z (about 1 year ago)
- Language: Swift
- Homepage:
- Size: 33.3 MB
- Stars: 3
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ParallaxAnimation
Simple parallax example for Horizontal and Vertical direction using UICollectionViewLayout modification.

```swift
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.
```swift
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.