我刚刚开始使用Storyboards
并希望为Transistion编写自定义Segue
类。
Transistion :我有一个当前ViewController A
,当我初始化ViewController B
时,ViewController A
滑到底部,ViewController B
出现在ViewController A
后面{ {1}}。使用nib
文件,我只是将ViewController放到一个Container中,但我希望在InterfaceBuilder
步骤
ViewController B
ViewController B
放在ViewController A
ViewController A
移出底部ViewController B
到目前为止我尝试过的是
- (void)perform
{
//#1
UIViewController *sourceViewController = (UIViewController *) self.sourceViewController;
UIViewController *destinationViewController = (UIViewController *) self.destinationViewController;
//#2
// [sourceViewController.view insertSubview:destinationViewController.view aboveSubview:sourceViewController.view] ;
[UIView animateWithDuration:2.0
animations:^{
//#3
sourceViewController.view.transform = CGAffineTransformMakeTranslation(0, sourceViewController.view.layer.frame.size.height);
}
completion:^(BOOL finished){
//#4
[[self sourceViewController] presentModalViewController:[self destinationViewController] animated:NO];
}
];
}
我的问题是#2:我怎样才能让新的ViewController“落后”当前的那个?并且只为其中一个制作动画?
答案 0 :(得分:0)
您可能想要探索ECSlidingViewController @ https://github.com/edgecase/ECSlidingViewController。我们有与您相似的要求,我们使用了这个MIT许可证类。