I am trying to create a custom segment so that the destination view controller moves from above.
I wrote my code according to the example from the documentation .
The problem is that when you run segue, the source view controller turns black, and then the animation happens. How can I prevent the view controller of the source image from getting black?
(I already tried to implement the solution presented in this answer , but after switching to the black screen or returning to the controller of the original form.)
Here is my code:
-(void)perform{
UIViewController *splashScreen = self.sourceViewController;
UIViewController *mainScreen = self.destinationViewController;
mainScreen.view.center = CGPointMake(mainScreen.view.center.x,
mainScreen.view.center.y-600);
[UIView animateWithDuration:1
animations:^{
mainScreen.view.center = CGPointMake(mainScreen.view.center.x, [[UIScreen mainScreen] bounds].size.height/2 );
}
];
[splashScreen presentModalViewController:mainScreen animated:NO];
}
source
share