Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS7 Implement UIViewControllerTransitioningDelegate with Storyboard

Since iOS7 we can create custom transition from view controller to view controller using UIViewControllerTransitioningDelegate which allows fine grained transitions.

viewController.transitioningDelegate  = transitioningDelegate;

I discovered that when using storyboard we already had the opportunity to create custom transitions using a custom UIStoryboardSegue but it seems the only way to implement custom transition with a storyboard.

How can I implement a transition delegate while using storyboard ?

like image 634
Nicolas Manzini Avatar asked Sep 30 '13 10:09

Nicolas Manzini


2 Answers

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

The idea is to use - prepareForSegue: to set the transitioningDelegate and the modalPresentationStyleto UIModalPresentationCustom. Then your transitioning delegate will have to take care of the transition.

like image 157
Fábio Oliveira Avatar answered Nov 10 '22 20:11

Fábio Oliveira


Check out the following example: https://github.com/soleares/SOLPresentingFun

It's an implementation of the sample code for WWDC Session 218: Custom Transitions Using View Controllers. It uses storyboards.

like image 3
Jesse Avatar answered Nov 10 '22 21:11

Jesse