A few months ago, I made this cool looking View Controller animation for my app Bicyclette.
I was tired of the “Horizontal Flip” animation, and I wanted to clarify the distinction between the main (foreground) and accessory (background)1 views.
Here is an open-source, cleaned-up version of this Fan Deck View Controller. It is a Container View Controller, which makes it easy to use:
Step 1: Configure the Front and Back View Controllers:
fanDeckVC.frontViewController = [[UIViewController alloc] initWithNibName:@"Main" bundle:nil];
fanDeckVC.backViewController = [[UIViewController alloc] initWithNibName:@"Settings" bundle:nil];
Step 2: Bind a control to switchVisibleViewController
, or use one of the completion-block variants.
Step 3: Change the rotation center to whatever you like:
fanDeckVC.rotationCenter = infoButton.center;
Here it is again, with the rotation center in the bottom right corner:
Please take a look at the (minimal) sample project, feel free hack around. Comments and patches are welcome, either on github or via Twitter.
-
e.g. the “Prefs”, “Info”, “About”, etc. view. ↩