Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/KelvinJin/AnimatedCollectionViewLayout
A UICollectionViewLayout subclass that adds custom transitions/animations to the UICollectionView without effecting your existing code.
https://github.com/KelvinJin/AnimatedCollectionViewLayout
animation cocoapods ios swift transition uicollectionview uicollectionviewlayout-subclass
Last synced: 6 days ago
JSON representation
A UICollectionViewLayout subclass that adds custom transitions/animations to the UICollectionView without effecting your existing code.
- Host: GitHub
- URL: https://github.com/KelvinJin/AnimatedCollectionViewLayout
- Owner: KelvinJin
- License: mit
- Created: 2017-02-08T06:57:03.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-09-20T07:09:55.000Z (about 4 years ago)
- Last Synced: 2024-04-24T14:47:41.502Z (8 months ago)
- Topics: animation, cocoapods, ios, swift, transition, uicollectionview, uicollectionviewlayout-subclass
- Language: Swift
- Homepage:
- Size: 2.06 MB
- Stars: 4,688
- Watchers: 72
- Forks: 347
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - AnimatedCollectionViewLayout - A UICollectionViewLayout subclass that adds custom transitions/animations to the UICollectionView. (UI / Animation)
- awesome-ios-star - AnimatedCollectionViewLayout - A UICollectionViewLayout subclass that adds custom transitions/animations to the UICollectionView. (UI / Animation)
- awesome-ios - AnimatedCollectionViewLayout - A `UICollectionViewLayout` subclass that adds custom transitions/animations to the `UICollectionView` without effecting your existing code. [•](https://camo.githubusercontent.com/7b304623ffbb82b31d5c6ee02e03fffdc1d9bb84/687474703a2f2f692e696d6775722e636f6d2f6a6f4131656d422e676966) (Content / Layout)
README
# AnimatedCollectionViewLayout
Normally a `UICollectionView` has no transition effects when you scroll from one item to another. There are lots of ways to write animations for UICollectionView, but using a UICollectionViewLayout subclass is by far the simplest one. And it doesn't break any of your existing code. You can still use your UICollectionView subclass and you don't need to change your UICollectionViewCell. Just plug and enjoy.
![CI Status](https://travis-ci.org/KelvinJin/AnimatedCollectionViewLayout.svg?branch=master)
Parallax
ZoomInOut
RotateInOut
Cards
CrossFade
Cube
Page
## Example
To run the example project, clone the repo, and start `iOS Example` in Xcode.
## Requirements
- iOS 9.0+
## Installation
### CocoaPods
To integrate AnimatedCollectionViewLayout into your Xcode project using CocoaPods, specify it in your `Podfile`:
For Swift 4.2 or above:
```ruby
pod 'AnimatedCollectionViewLayout'
```For Swift 4.1 or below:
```ruby
pod 'AnimatedCollectionViewLayout', '~> 0.3.0'
```### Carthage & SPM
Carthage and Swift Package Manager are also supported.
## Usage
### Get Started
Import the library where you want to use it. Create a `AnimatedCollectionViewLayout` object, set its `animator` and assign it to your `UICollectionView`.
```swift
import AnimatedCollectionViewLayout// ...
let layout = AnimatedCollectionViewLayout()
layout.animator = ParallaxAttributesAnimator()
collectionView.collectionViewLayout = layout
```### Customization
Most of the built-in animators work best in **Paging** mode and they have additional parameters that you can tweak for better transitions.
You can also write your own animators by implementing the protocol `LayoutAttributesAnimator`.## Author
[Jin Wang](https://twitter.com/jinw1990)
## License
AnimatedCollectionViewLayout is available under the MIT license. See the LICENSE file for more info.