0

This answer suggests registering a UINavigationControllerDelegate for receiving notifications about when segues are done. This should work in the case of push segues where originating view controllers have navigation controllers.

But how about modal segues? Can something like this (a callback to navigationController:didShowViewController:animated:) apply in the case of modal segues as well?

Community
  • 1
  • 1
Drux
  • 11,992
  • 13
  • 66
  • 116
  • 1
    use unwind segue http://stackoverflow.com/questions/12561735/what-are-unwind-segues-for-and-how-do-you-use-them – Vladimir Berezkin Feb 10 '15 at 09:11
  • @Rimidalv can you please elaborate. E.g., how could in [this](http://stackoverflow.com/questions/28419994/unit-testing-asychronous-ui-code-which-does-not-know-about-xctestexpectations) example `A` use an unwind segue for finding out that its (modal, animated) segue to `B` is done? – Drux Feb 10 '15 at 09:15
  • I recommend present view controllers manually. It allows you to do whatever you want and you gain all the control. – orkenstein Feb 10 '15 at 09:21
  • @orkenstein what do you mean by *manually* in this context? – Drux Feb 10 '15 at 09:35
  • 1
    @Drux, you want to show VC modally, right? Then manually instantiate your VC and call `presentViewController:animated:completion:` – orkenstein Feb 10 '15 at 09:45
  • @orkenstein I see. Have you ever tried such manual (animated) presentations in the case of unit tests (as in my [related](http://stackoverflow.com/questions/28419994/unit-testing-asychronous-ui-code-which-does-not-know-about-xctestexpectations) question)? – Drux Feb 10 '15 at 09:50
  • @Drux, never. I think `completionBlock` might be helpful in your case. – orkenstein Feb 10 '15 at 09:58

0 Answers0