RAFlipReplaceSegue
A simple way to alternate between UIViewControllers in a UINavigationController stack, via a storyboard-compatible custom segue. For iOS using ARC.
Install / Use
/learn @ryanartecona/RAFlipReplaceSegueREADME
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,
- Drag a new view controller into the storyboard, if necessary.
- Control-drag to wire up a segue as usual.
- In the inspector panel for the segue, choose
Customas the segue's style, and typeRAFlipReplaceSegueas 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):
UIViewAnimationOptionTransitionNoneUIViewAnimationOptionTransitionFlipFromLeftUIViewAnimationOptionTransitionFlipFromRightUIViewAnimationOptionTransitionCurlUpUIViewAnimationOptionTransitionCurlDownUIViewAnimationOptionTransitionCrossDissolveUIViewAnimationOptionTransitionFlipFromTopUIViewAnimationOptionTransitionFlipFromBottom
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.
Related Skills
node-connect
341.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.5kCommit, push, and open a PR
