Coder Social home page Coder Social logo

austinvernsonger / jvtransitionanimator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jv17/jvtransitionanimator

0.0 1.0 0.0 176.09 MB

A simple transition animator which allows you to perform custom animation when presenting an UIViewController.

Home Page: http://jv17.github.io/JVTransitionAnimator

License: MIT License

Ruby 3.94% Objective-C 81.86% C 1.30% Shell 12.90%

jvtransitionanimator's Introduction

JVTransitionAnimator Version License Platform

JVTransitionAnimator is a simple helper framework which allows you to present your View Controllers in a pretty cool way, with the use of Transition Animations. Pretty easy to use and customizable.

Previews

• Custom Animations

screenshot-1

• Pre-defined Animations

screenshot-2

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

  • Now, just create a JVTransitionAnimator property.
- (JVTransitionAnimator *)transitionAnimator
{
    if(!_transitionAnimator)
    {
        _transitionAnimator = [[JVTransitionAnimator alloc] init];
    }

    return _transitionAnimator;
}
  • To enabled interactive transitions you do this, for example, in the viewDidAppear of your UIViewController. Also, we need to set our transition delegate.
- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];

    // we need to tell our transition animator the current view controller & the new controller to be pushed
    self.transitionAnimator.fromViewController = self;
    self.transitionAnimator.toViewController = self.secondController;

    // enabling interactive transitions
    self.transitionAnimator.enabledInteractiveTransitions = YES;

    // also don't forget to tell the new UIViewController to be presented that we will be using our animator & choose the animation
    self.transitionAnimator.slideInOutAnimation = YES;
    self.secondController.transitioningDelegate = self.transitionAnimator;
}
  • Then, we can further setup and customize our Transition Animations.
// here is the trick if you want longer animations or set a delay or event not bouncing (known as dampling) at all
self.transitionAnimator.duration = 1.0f;
self.transitionAnimator.delay = 0.0f;
self.transitionAnimator.damping = 0.5f;
self.transitionAnimator.velocity = 0.9f;
  • Finally, to trigger transitions we just need to make a simple presentViewController function call.
// whenever you want to present the new view controller animated
[self presentViewController:self.secondController animated:YES completion:nil];

Requirements

Developed and tested using iOS8+.

Installation

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

pod "JVTransitionAnimator"

Author & Support

Contact me if you find any bugs or potential room for improvements. Jorge Valbuena (@JV17), [email protected]. BTW! You are welcome to help in supporting this pod or making improvements to it.

License

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

jvtransitionanimator's People

Contributors

jv17 avatar jvdev17 avatar

Watchers

James Cloos 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.