Giter Site home page Giter Site logo

teehanlax / uiviewcontroller-transitions-example Goto Github PK

View Code? Open in Web Editor NEW
267.0 31.0 34.0 4.95 MB

An example of how to use the new iOS 7 APIs to create custom view controller transitions.

Home Page: http://www.teehanlax.com/blog/custom-uiviewcontroller-transitions/

License: MIT License

Objective-C 95.77% C 4.23%

uiviewcontroller-transitions-example's Introduction

UIViewController-Transitions-Example

An example of how to use the new iOS 7 APIs to create custom view controller transitions. For more details, read the tutorial.

How to Use

There are three custom transitions:

  • TLTransitionAnimator is a non-interactive transition that presents a new view controller while keeping the presenting view controller on screen (impossible in iOS 6).
  • TLMenuInteractor is an transition that shows how to use interactive and non-interactive transitions together using traditional UIKit animations.
  • TLMenuDynamicInteractor is a transition that shows how to use interactive and non-interactive transitions together using UIKit Dynamics.

Tapping a row in the table view will present a new view controller using the TLTransitionAnimator. Swiping from the left edge of the screen will present an orange menu view controller. Change the USE_UIKIT_DYNAMICS macro in TLMasterViewController.m to switch between TLMenuInteractor and TLMenuDynamicInteractor.

Faux Modal

Menu

License

This software is released under the MIT license.

uiviewcontroller-transitions-example's People

Contributors

ashfurrow 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uiviewcontroller-transitions-example's Issues

Code that sets the size, tintAdjustmentMode and userInteractionEnabled is ignored for non-animated transitions.

If I uncheck the "Animates" checkbox for the segue with the identifier "details" the code in TLTransitionAnimator.m will be ignored and the small gray view will be displayed fullscreen instead.

This comment in UIViewControllerTransitioning.h appears to promise that the custom UIViewControllerAnimatedTransitioning will be used for non-animated transitions, too.

@protocol UIViewControllerContextTransitioning <NSObject>
...
// Most of the time this is YES. For custom transitions that use the new UIModalPresentationCustom
// presentation type we will invoke the animateTransition: even though the transition should not be
// animated. This allows the custom transition to add or remove subviews to the container view. 
- (BOOL)isAnimated;
...

Do you have an idea how to make it work for non-animated transitions?

Boundary issue using UIKit Dynamics.

Hello,
after showing the left view controller using UIKit Dynamics, view's x-origin is sometimes 0.5f. You can notice that white line on the left side.
I can just adjust the frame at the end of the animation, but I can not prevent that the line appears during the animation. Can you help me? Thanks!

Dismissing modal views by "touch outside"

Referring to the modal view presented when clicking on the cell, is it currently possible to dismiss the same view by touching anywhere outside of the visible area? Not an issue per se, but wondering whether this has been explored with the new API. This is technically the first time that you can officially present a modal view from another UIViewController on an iPhone, so I'm not quite sure how to approach this. Thanks!

Dismissing modal view controller causes the screen to black out - iOS 8

Reproduction Steps:

  1. Launch the app
  2. Tap on "Present view controller"
  3. Tap the "done" button
  4. Black screen appears

I think I found the place where the problem seems to be.
In iOS 8 [transitionContext completeTranstion:YES] seems to be doing something weird. If you comment that line of code out, you can see the destination view controller, but cannot interact with it.

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.