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.9k
關注者數68
派生數351
提交數67
已啟用問題?
問題數61
打開的問題數27
拉請求數7
打開的拉請求數0
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?