GithubHelp home page GithubHelp logo

vhikd / animatedcollectionviewlayoutobjc Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 1.55 MB

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

Objective-C 100.00%
object-c uicollectionview uicollectionviewlayout-subclass transition-animation-ios

animatedcollectionviewlayoutobjc's Introduction

AnimatedCollectionViewLayoutObjC

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.

This Layout was written by Object-C base on the >AnimatedCollectionViewLayout. And add two kinds of animte Move In and Move out.

Warning

This layout just work with UICollectionViewScrollDirectionHorizontal.

Demo

Parallax ZoomInOut RotateInOut Cards
CrossFade Cube Page Move In
Move Out No animate

Example

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

Requirements

  • iOS 7.0+

Usage

Get Started

Import the library where you want to use it. Create a HorizontalFlowLayout object, set its animator and assign it to your UICollectionView.

  HorizontalFlowLayout *lay = [HorizontalFlowLayout new];
  lay.scrollDirection = UICollectionViewScrollDirectionHorizontal;  
  lay.animator = [ParallaxAttributesAnimator new];
  lay.shouldReLayout = YES;
  UICollectionView *collect = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) collectionViewLayout:lay];

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.

License

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

animatedcollectionviewlayoutobjc's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.