Need help with AnimatedCollectionViewLayout?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

KelvinJin
4.3K Stars 329 Forks MIT License 67 Commits 23 Opened issues

Description

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

Services available

!
?

Need anything else?

Contributors list

# 20,887
iOS
Ruby
Swift
cocoapo...
49 commits
# 166,389
Swift
cocoapo...
openvr
Dart
1 commit
# 152,634
iOS
Objecti...
Swift
cocoapo...
1 commit
# 148,818
Objecti...
Swift
cocoapo...
uiimage...
1 commit
# 97,470
Ruby
Swift
travis
bitbuck...
1 commit
# 2,194
Objecti...
Dart
carthag...
sdwebim...
1 commit

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

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:

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.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.