Coder Social home page Coder Social logo

round-and-round-kit's Introduction

Description

Adds 3D rotating view transitions to UINavigationController.

I always liked how switching users on OSX rotates the view in a cube, and thought it would also be a nice way to switch between contexts in iPhone applications. There's a cube transition is in the iOS SDK, however it's a private API. So here's an open source implementation that does more or less the same thing. Key features are:

  • Just one category to add to your project.
  • Push with 3D rotations in one line.
  • Back button behavior is taken care of - the category will know when to pop with rotation vs default animation style.
  • No private API calls.

Usage

Getting Started

Clone the module and run the example.

Pushing a view controller

[navigationController pushViewController:_secondViewController rotated:YES];

Popping a view controller

[navigationController popViewControllerRotated:YES];

. . . or if using SWIZZLE_BACK (see below) just do a regular pop:

[navigationController popViewControllerAnimated:YES];

Back button behavior

Use SWIZZLE_BACK = YES (default) to tell the UINavigationController to track which animation style was used when pushing a view controller. It will then apply the same when popping. The benefit of this is you don't have to do anything to handle back button behavior. The drawback is that it's:

  • You just swizzled a UIKit class. Discouraged (but not banned) by Apple
  • May require updates for future iOS SDK versions.

. . . If you don't want this behavior, set this option to NO in UINavigationController+PushPopRotated.h.

#Example Video

'Scuse the poor quality video, but it seems that animated gif is the only format that will currently play inside a README.md.

Limitations

Currently the view does not update during the 0.75secs that a transition is in progress. It's necessary to set up the view beforehand.

Installation

Option 1 - Source

  • Copy UINavigationController+PushPopRotated.h and UINavigationController+PushPopRotated.m to your project's source folder.
  • Copy JRSwizzle.h and JRSwizzle.m to your project's source folder.

Option 2 - Framework

Not available yet.

Authors

LICENSE

Apache License, Version 2.0, January 2004, http://www.apache.org/licenses/

round-and-round-kit's People

Contributors

jasperblues avatar magicsam avatar

Watchers

James Cloos avatar Janak Nirmal 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.