AnimatedCollectionViewLayout

A UICollectionViewLayout subclass that adds custom transitions/animations to the UICollectionView without effecting your existing code.

Github stars Tracking Chart

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

Example

To run the example project, clone the repo, and start iOS Example in Xcode.

Requirements

  • iOS 8.0+

Installation

CocoaPods

To integrate AnimatedCollectionViewLayout into your Xcode project using CocoaPods, specify it in your Podfile:

For Swift 4.2 or above:

pod 'AnimatedCollectionViewLayout'

For Swift 4.1 or below:

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.

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

License

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

Main metrics

Overview
Name With OwnerKelvinJin/AnimatedCollectionViewLayout
Primary LanguageSwift
Program languageRuby (Language Count: 3)
Platform
License:MIT License
所有者活动
Created At2017-02-08 06:57:03
Pushed At2020-09-20 07:09:55
Last Commit At2020-09-20 17:09:55
Release Count11
Last Release Name1.1.0 (Posted on )
First Release Name0.1.0 (Posted on )
用户参与
Stargazers Count4.8k
Watchers Count70
Fork Count352
Commits Count67
Has Issues Enabled
Issues Count61
Issue Open Count27
Pull Requests Count7
Pull Requests Open Count0
Pull Requests Close Count1
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private