Code Monkey home page Code Monkey logo

transitioningkit's Introduction

TransitioningKit

PRERELEASE

Version Carthage

TransitioningKit is a Swift framework providing a set of components for simplifying, clarifying, & standardizing the implemention of custom Navigation & View Controller transitions.

TransitioningKit currently provides three commonly needed public classes, and one public protocol:

PSNavigationControllerDelegate

A concrete implementation of the UINavigationControllerDelegate protocol.

When assigned to the delegate property of a UINavigationController, PSNavigationControllerDelegate assumes the responsibility of vending UIViewControllerAnimatedTransitioning (“animator”) and UIPercentDrivenInteractiveTransition (“interaction controller”) objects for push and pop transitions.

PSViewControllerTransitioningDelegate

A concrete implementation of the UIViewControllerTransitioningDelegate protocol.

Similar to PSNavigationControllerDelegate, when assigned to the transitioningDelegate property of a UIViewController, PSViewControllerTransitioningDelegate assumes the responsibility of vending UIViewControllerAnimatedTransitioning (“animator”), UIPercentDrivenInteractiveTransition (“interaction controller”), and UIPresentationController (“presentation controller”) objects for present and dismiss transitions.

PSPanGestureInteractionController

A subclass of UIPercentDrivenInteractiveTransition.

PSPanGestureInteractionController coordinates a UIPanGestureRecognizer to simplify implementation of common gesture driven interactive transitions. It includes simple a delegate protocol which you implement to customize behavior for your application.

PSPanGestureInteractionControllerDelegate

A custom protocol for handling PSPanGestureInteractionController events within your application.

Example

Example

Here we have a simplified example of transitioning between three view controllers.

1. First View Controller → Second View Controller

In this instance, we are seeing a custom, interactive, “push” operation between these two view controllers. Here are the parts involed in this operation:

  1. FirstViewToSecondViewPushAnimator implements the animation.
  2. FirstViewInteractionControllerDelegate handles the pan gesture.
  3. PSPanGestureInteractionController is instantiated with FirstViewInteractionControllerDelegate.
  4. PSNavigationControllerDelegate is instantiated with the interaction controller and the animator.
  5. PSNavigationControllerDelegate is assigned as the navigation controller delegate.
2. Second View Controller → Third View Controller

In this instance, we are seeing a modal “present” & “dismiss” operation between these two view controllers.

  1. ThirdViewControllerPresentAnimator and ThirdViewControllerDismissAnimator implement the animations.
  2. PSViewControllerTransitioningDelegate is instantiated with the animators.
  3. PSViewControllerTransitioningDelegate is assigned to as the modal view controller's transitioningDelegate.

Installation

Carthage

Add the following to your project's Cartfile:

github "puffinsupply/TransitioningKit" >= 0.0.1

License

transitioningkit's People

Contributors

soopa avatar

Watchers

 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.