Git Product home page Git Product logo

drdynamicslideshow's Introduction

DRDynamicSlideShow

A UIScrollView subclass to easily implement an amazing swiping interactive slide show, as IFTTT's.

DRDynamicSlideShow GIF

No external frameworks or subclasses for subviews needed. Just add a DRDynamicSlideShow to your view, and add DRDynamicSlideShowAnimation's to it to let the magic happen.

How to use

Here's an super simple example of how to use DRDynamicSlideShow. You can check out the example app, too.

  1. First, add a DRDynamicSlideShow instance to your view.

  2. Then, you can use the following method to add subviews to it on the page you want (you can simply use addSubview: as well):

     [self.slideShow addSubview:coolSubview onPage:0];
    
  3. Finally, you just need to add whatever animation you want it to perform for those subviews when the specified page is being swiped.

     [self.slideShow addAnimation:[DRDynamicSlideShowAnimation animationForSubview:coolSubview page:0 keyPath:@"alpha" toValue:@0 delay:0]];
    

    or

     [self.slideShow addAnimation:[DRDynamicSlideShowAnimation animationForSubview:coolSubview page:0 keyPath:@"alpha" fromValue:@0 toValue:@1 delay:0]];
    

Notice there are two ways for instantiating DRDynamicSlideShowAnimation. If you want the subview to animate from its current value, just use animationForSubview:page:keyPath:toValue:delay:. Else, use animationForSubview:page:keyPath:fromValue:toValue:delay:.

As you can see, all we need for adding each animation is just 1 line of code! Pretty amazing, isn't it? :)

Known issues

  • The animation used to go to next page by tapping the view does not consider DRDynamicSlideShowAnimation's delay property.

LICENSE

You can use it for whatever you want, however you want. I just would love to know if you're using it in any project of yours.

drdynamicslideshow's People

Contributors

rais38 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.