Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to execute some code after a segue is done?

Is it possible in iOS 6 to know when a UIStoryboardSegue has finished its transition? Like when i add a UIStoryboardSegue from UIButton to push another UIViewController on the navigationcontroler, i want to to something right after the push-transition is finished.

like image 920
bogen Avatar asked Aug 19 '13 09:08

bogen


2 Answers

You can use the UINavigationControllerDelegate protocol and then define:

– navigationController:didShowViewController:animated: 
like image 111
New Avatar answered Oct 02 '22 15:10

New


In case you don't want to use the viewDidAppear: method, you could create a custom segue. In the perform method you would use an animation for the transition, and that can have a completion block. You can add the code there after the animation is complete.

like image 36
Levi Avatar answered Oct 02 '22 17:10

Levi