AnimatedCollectionViewLayout

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

Github星跟踪图

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.

主要指标

概览
名称与所有者KelvinJin/AnimatedCollectionViewLayout
主编程语言Swift
编程语言Ruby (语言数: 3)
平台
许可证MIT License
所有者活动
创建于2017-02-08 06:57:03
推送于2020-09-20 07:09:55
最后一次提交2020-09-20 17:09:55
发布数11
最新版本名称1.1.0 (发布于 )
第一版名称0.1.0 (发布于 )
用户参与
星数4.8k
关注者数70
派生数352
提交数67
已启用问题?
问题数61
打开的问题数27
拉请求数7
打开的拉请求数0
关闭的拉请求数1
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?