Displacing one view with another with a custom segue animation?

痞子三分冷 提交于 2019-12-03 09:13:24

I don't quite get what you mean by new and old so i assume new = dst and old = src.

- (void) perform {

   UIViewController *src = (UIViewController *) self.sourceViewController;
   UIViewController *dst = (UIViewController *) self.destinationViewController;

   src.view.transform = CGAffineTransformMakeTranslation(0, 0);
   dst.view.transform = CGAffineTransformMakeTranslation(0, -480);

   [UIView animateWithDuration:2.0
                 animations:^{
                     [src presentModalViewController:dst animated:NO];
                     src.view.transform = CGAffineTransformMakeTranslation(0, 480);
                     dst.view.transform = CGAffineTransformMakeTranslation(0, 0);
                 }
   ];
}

This should do it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!