UINavigationController Cube Transition

Here’s some code for a not bad looking little scrunchy push-ish transition for the case of jumping out of one hierarchy and directly to another off the root with a UINavigationController:


There’s a video showing it here as well.

At this exact moment what we want to do is not jump around in a navigation hierarchy but toggle between a navigation stack and a plain UIView, but the code looks pretty applicable to that as well. If we run into any problems with that, we’ll be sure to let you know!

h/t: @fabiankr!


Yep, took us 9 minutes flat to convert the code linked above into a UIWindow method to replace its main view with a transition and test, works perfectly and looks quite appropriate for the use case we’ve got for the switching between error view and navigation stack here. Ex-cellent!

Alex | November 30, 2010
  • Brandon Williams December 1, 2010 at 7:35 am
    You can change the line sublayerTransform.m34 = 1 / -1000; to something larger (say -1/400) to get more of a "cube-y" feel to the transition. This value controls the perspective of the 3D transformation, and the smaller it is the closer it appears to being isometric. That is why it looks so scrunchy.

Leave a Reply