Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A simple way to alternate between UIViewControllers in a UINavigationController stack, via a storyboard-compatible custom segue. For iOS using ARC.

branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.md

RAFlipReplaceSegue

A simple way to alternate between UIViewControllers in a UINavigationController stack, via a storyboard-compatible custom segue. (Also compatible with view controllers outside a navigation controller stack)

Based mostly on an example provided by jrwren.

Usage

Usage in code is the same as for any other segue. To use with storyboards,

  1. Drag a new view controller into the storyboard, if necessary.
  2. Control-drag to wire up a segue as usual.
  3. In the inspector panel for the segue, choose Custom as the segue's style, and type RAFlipReplaceSegue as the segue's custom class.

Done!

Customization

To use a different built-in transition style while keeping the segue functionality, in RAFlipReplaceSegue.m change UIViewAnimationOptionTransitionFlipFromLeft to one of the following (from the UIView reference):

  • UIViewAnimationOptionTransitionNone
  • UIViewAnimationOptionTransitionFlipFromLeft
  • UIViewAnimationOptionTransitionFlipFromRight
  • UIViewAnimationOptionTransitionCurlUp
  • UIViewAnimationOptionTransitionCurlDown
  • UIViewAnimationOptionTransitionCrossDissolve
  • UIViewAnimationOptionTransitionFlipFromTop
  • UIViewAnimationOptionTransitionFlipFromBottom

If you need something more different, read the .m implementation—it's only ~30 lines!

If this helps at all, or is not quite what you need, drop me a tweet @ryanartecona.

Something went wrong with that request. Please try again.