目的のビュー コントローラーが上から下にスライドするように、カスタム セグエを作成しようとしています。
ドキュメントの例に従ってコードを書きました。
問題は、セグエが実行されると、ソース ビュー コントローラーが黒くなり、アニメーションが発生することです。ソースビューコントローラーが黒くなるのを防ぐにはどうすればよいですか?
(この回答で提示されたソリューションを既に実装しようとしましたが、移行後に画面が真っ暗になるか、ソース ビュー コントローラーに戻ります。)
これが私のコードです:
-(void)perform{
UIViewController *splashScreen = self.sourceViewController;
UIViewController *mainScreen = self.destinationViewController;
//Place the destination VC above the visible area
mainScreen.view.center = CGPointMake(mainScreen.view.center.x,
mainScreen.view.center.y-600);
//Animation to move the VC down into the visible area
[UIView animateWithDuration:1
animations:^{
mainScreen.view.center = CGPointMake(mainScreen.view.center.x, [[UIScreen mainScreen] bounds].size.height/2 );
}
];
[splashScreen presentModalViewController:mainScreen animated:NO];
}