Giter Club home page Giter Club logo

ddhdynamicviewcontrollertransitions's Introduction

DDHDynamicViewControllerTransitions

Version Platform

Custom view controller transitions using UIDynamic behaviors.

Snap

Gravity

Gravity + Rotation

Usage

Create an instance of DDHNavigationControllerDelegate and make it the delegate of you navigation controller.

Example:

#import "DDHAppDelegate.h"
#import "DDHFirstViewController.h"
#import "DDHNavigationControllerDelegate.h"

@interface DDHAppDelegate ()
@property (nonatomic, strong) DDHNavigationControllerDelegate *navigationControllerDelegate;
@end

@implementation DDHAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    DDHFirstViewController *firstViewController = [[DDHFirstViewController alloc] initWithNibName:@"DDHFirstViewController" bundle:nil];
    UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:firstViewController];
    
    self.navigationControllerDelegate = [[DDHNavigationControllerDelegate alloc] initWithTransitionType:1];
    navigationController.delegate = self.navigationControllerDelegate;
    
    self.window.rootViewController = navigationController;
    
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    return YES;
}

Important: The navigation controller assigns it's delegate. Therefore you will need a reference to the navigation controller delegate somewhere. You can do this eighther in Interface Builder of in code like in the example.

To change the transition type on the fly set the transitionType of the navigation controller delegate.

Using a storyboard

#import "DDHNavigationControllerDelegate.h"

...

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    ((DDHNavigationControllerDelegate*)self.navigationController.delegate).transitionType = DDH_TRANSITION_TYPE_GRAVITY;
}

Without a storyboard

#import "DDHNavigationControllerDelegate.h"

...

- (void)pushSecondViewController {
    ((DDHNavigationControllerDelegate*)self.navigationController.delegate).transitionType = DDH_TRANSITION_TYPE_GRAVITY;

    DDHSecondViewController *secondViewController = [[DDHSecondViewController alloc] initWithNibName:@"DDHSecondViewController" bundle:nil];
    [self.navigationController pushViewController:secondViewController animated:YES];
}

If you don't want to include the header file into your code you can use Key-Value-Coding:

[(NSObject*)self.navigationController.delegate setValue:@1 forKey:@"transitionType"];

Requirements

ARC and iOS7.

Installation

Using CocoaPods

DDHDynamicViewControllerTransitions is available through CocoaPods, to install it simply add the following line to your Podfile:

pod "DDHDynamicViewControllerTransitions"

Manual

Download the project and add the files DDHNavigationControllerDelegate.{h,m} and the directory DynamicTransitionAnimators to your project.

Author

Dominik Hauser, [email protected]

License

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

ddhdynamicviewcontrollertransitions's People

Contributors

dasdom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ddhdynamicviewcontrollertransitions's Issues

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.