Skip to content

IFTTT-like intro slide show based on UIScrollView

License

Notifications You must be signed in to change notification settings

lunayo/DRDynamicSlideShow

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DRDynamicSlideShow

Create beautiful, animated, paging UIScrollViews. Easily animate views as the UIScrollView gets paged. This is perfect for welcome screens and introduction views in iOS apps.

DRDynamicSlideShow

Features

  • 1 line of code per animation.
  • Any type of value can be animated.
  • Block-driven.

Installation

There are two ways to install DRDynamicSlideShow. The first (and preferred / recommended) method is through CocoaPods. If you prefer to do it the classic way, see instructions for manual install below.

CocoaPods Install

You can install DRDynamicSlideShow through CocoaPods by adding the following to your Podfile:

pod 'DRDynamicSlideShow'

Manual Install

You can add DRDynamicSlideShow to your project by copying DRDynamicSlideShow.h and DRDynamicSlideShow.m. Ensure that they are copied into the project. Note, installing with this method will not keep DRDynamicSlideShow updated (you'll need to check GitHub).

Usage

Using DRDynamicSlideShow is easy. There are two ways to use it - either set it up programatically or with an interface. The demo project demonstrates setup with a Storyboard.

  1. Add a DRDynamicSlideShow instance to your view.

  2. 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. Just need 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:. Otherwise, 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? :)

Requirements

  • Optimized for iOS 7 SDK and higher
  • Built for iOS 6 SDK or higher
  • Uses Objective-C ARC

License

DRDynamicSlideShow is available under the MIT license. Also, I'd really love to know if you are using DRDynamicSlideShow in any of your projects, so send me an email or a tweet and make my day :)

To-do

About

IFTTT-like intro slide show based on UIScrollView

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 97.0%
  • Ruby 3.0%