使い始めたばかりで、トランジション用のカスタム クラスStoryboardsを書きたいと思っています。Segue
Transistion : 私は電流を持っていて、ViewController A初期化すると、下ViewController BにViewController AスライドしてViewController B後ろに表示されViewController Aます。ファイルを使用nibすると、両方の ViewController を 1 つのコンテナーにするだけですが、同じことをコンテナー内で実現したいと考えています。InterfaceBuilder
手順
- 作成
ViewController B ViewController B後ろに置くViewController AViewController 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を取得するにはどうすればよいですか?それらの1つだけをアニメーション化しますか?