I'm using a simple custom segue from my UIViewController to a UINavigationController which holds UICollectionViewController as it's root view controller.
The transition works as expected, but i first see a black screen and only when the transition has ended i see the UICollectionViewController content.
Storyboard:
Segue:
This is the code for the custom segue:
- (void)perform {
UIViewController *sourceViewController = self.sourceViewController;
UINavigationController *destinationViewController = self.destinationViewController;
[UIView animateWithDuration:0.25
delay:0.0
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
destinationViewController.topViewController.view.transform =
CGAffineTransformMakeTranslation(0, 0);
sourceViewController.view.transform =
CGAffineTransformMakeTranslation(-sourceViewController.view.frame.size.width, 0);
}
completion:^(BOOL finished){
[destinationViewController.topViewController.view removeFromSuperview]; // remove from temp super view
[sourceViewController presentViewController:destinationViewController animated:NO completion:NULL]; // present VC
}];
}
NOTE:
When i am running a simple show
segue, the collection view is loaded as it should, No black screen.
Any idea what i'm doing wrong here?