So I've got a screen that does a check for certain attributes and under defined circumstances will instantly load another view modally in viewDidLoad
, without animation, over the currently-loading view (so as not to show the view below). Prior to iOS 8 when this was done, the original view would pause its loading (would not proceed with viewWillAppear
, viewDidLayoutSubviews
etc.) until the overlaying controller was dismissed. This behaviour I found was appropriate for my needs, as any animation on elements in the original view, could then be done. However, in iOS 8 I'm getting a completely different chain of events. First off, for some reason viewDidLayoutSubviews
is being called twice (what's up with that?) but more importantly the view is not liking another controller being popped up at all anytime before viewDidAppear
, complaining about unbalanced calls to begin/end appearance transitions
. Not only that, but the underlying viewController
continues with it's loading (viewWillAppear
,viewDidLayoutSubviews
etc.) even though it's not being shown which causes all the methods in those events to fire. I appreciate if Apple have updated the way something like this is meant to be achieved, so if the new meta is a completely different process I'm willing to adopt, however, as it is I can't get this to work appropriately.
I'd appreciate any help on how to get this modal view to interject without causing the underlying view to continue it's loading.
Thanks,
Mike
UPDATE: Going to bring some code in. Below is the viewDidLoad
of the main viewController
that presents the modal VC if need.
-(void) viewDidLoad{
if(hasNotSeenTutorial){
TutVC* vc = [[TutVC alloc] initWithNibName:@"tutNib" bundle:nil]
vc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self.navigationController presentViewController:vc animated:NO completion:^{
NSLog(@"Has Completed Presentation");
}];
}
}
This is where the issues are. Calling the presentation here in viewDidLoad
, causes the presentation of the presenting VC to continue. Prior to iOS 8 the presenting VC if not yet presented, would pause, until the modal VC had been dismissed, it would then complete as usual. This is not the case in iOS 8, as per my original post.