我创建了一个自定义 segue:
-(void)perform{
UIViewController *destination = [self destinationViewController];
UIViewController *source = [self sourceViewController];
[source.view addSubview:destination.view];
CGRect destionationFrame = destination.view.frame;
CGRect sourceFrame = source.view.frame;
CGSize sourceSize = CGSizeMake(sourceFrame.size.height, sourceFrame.size.width);
destination.view.frame = CGRectMake(sourceSize.width,0,destionationFrame.size.width,destionationFrame.size.height);
[UIView animateWithDuration:0.3
delay:0
options:UIViewAnimationCurveEaseInOut | UIViewAnimationOptionBeginFromCurrentState
animations:^{
destination.view.frame = CGRectMake(sourceSize.width-destionationFrame.size.width,0,destionationFrame.size.width,destionationFrame.size.height);
} completion:^(BOOL finished) {
//[source presentModalViewController:destination animated:NO completion:nil];
//[source presentModalViewController:destination animated:NO];
}];
}
问题是,如果我在动画完成后什么都不做,触摸目标控制器的任何控件都会导致应用程序崩溃。
如果我制作一个 presentModalViewController 会导致屏幕上的任何对象都有响应。
有什么帮助吗?谢谢