I am presenting a simple modal ViewController calling
[self performSegueWithIdentifier:@"SegueLogOut" sender:nil];
However when i dismiss it I want it to move upwards instead of downwards, it it possible?
[self dismissViewControllerAnimated:YES completion:nil];
EDIT:
I tried to make a custom animation, It didn't work really well. The background stays black until the modal is dismissed...
[UIView animateWithDuration:1 animations:^{
self.view.frame = CGRectMake(0, -self.view.frame.size.height, self.view.frame.size.width, self.view.frame.size.height);
} completion:^(BOOL finished) {
[self dismissViewControllerAnimated:NO completion:nil];
} ];
Generally, to change the presentViewController
animation style, you set a modalTransitionStyle
property on the viewController
.
However, to answer your question, none of the ( few ) modalTransitionStyle
s have a predefined style to animate upwards.
You need to do the animation yourself.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.