4

So in my code, I have a Tab Bar controller. When you click one of the tabs, it calls this code to open up a new storyboard (for video capture).

NavController *NC = [[NavController alloc] initWithCaptureInput];
[self presentViewController:NC animated:YES completion:nil];

In this view, he records a video and then the storyboard presents the segue. In that view, the user can preview his video. When he click's a button the storyboard pushes him to the next view.

In that last view, I use to call this in iOS 7 to make the app go back to the initial view (before the current storyboard).

[self.presentingViewController.presentingViewController dismissViewControllerAnimated:YES completion:nil];

This worked fine but in iOS 8, the top view is dismissed, and during the animation, you see the video preview view. Its only when the animation is done that the video preview view is removed (as it should be).

Can anyone tell me how I can have my proper animation where the top view is removed and during the animation you only see the initial view? This could be done if the app was to remove all the views at the same time (animating them at the same time too).

Jenz
  • 8,009
  • 6
  • 38
  • 69
NickProvost
  • 357
  • 5
  • 20

1 Answers1

1

Yes, I've noticed that behavior, too. Unwind segues (as described in Technical Note TN2298) appear to handle this more gracefully.

In the view controller that you want to unwind to, add a method that looks like:

// use whatever name most descriptively captures the functional purpose of the 
// view controller that you are unwinding _to_

- (IBAction)unwindToMainMenu:(UIStoryboardSegue*)sender
{
}

Then in the IB scene that you are transitioning from, you can control+drag from the "dismiss" button to the exit outlets control (as shown in that technical note or as shown here or here) and choose your unwind segue. In my casual experimentation, when you perform the unwind segue, it would appear that you do not see the interim views briefly during the transition.

Community
  • 1
  • 1
Rob
  • 371,891
  • 67
  • 713
  • 902
  • So I tried an unwind segue. But theres a similar problem. Instead of the current view animating and then the view under it disappearing after, it seems as the current view is disappearing and the view under it is animating out of view. I feel like unwind segues might be my best bet tho. – NickProvost Sep 29 '14 at 18:12
  • Here's the same problem in iOS8.4 http://stackoverflow.com/questions/31396193/impossible-animation-with-dismissviewcontrolleranimated-ios8-4 – Chisx Jul 14 '15 at 02:07