我有几个 UIViewControllers,它们在右侧包含相同的信息,但在屏幕左侧包含不同的信息。我想从一个过渡到另一个,但只为左侧设置动画,即向上滑动左侧,同时保持右侧静止。
-(void)goNextStep{
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle: nil];
NSString *identifier = @"";
if (_model.isLoggedIn) {
//The user is already logged in, don't display the loginViewController
// instead take them to the next viewController
identifier = [_model nextStepIdentifier];
if ([identifier isEqualToString:@""]) {
identifier = @"loginController";
}
}else{
identifier = @"loginController";
}
UIViewController *nextVC = (UIViewController *)[mainStoryboard instantiateViewControllerWithIdentifier:identifier];
[nextVC setHidesBottomBarWhenPushed:YES];
CATransition *transition = [CATransition animation];
transition.duration = 0.5f;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromBottom;
transition.delegate = self;
//I would love to have
//transition.rect=MyRect;
[self.navigationController.view.layer addAnimation:transition forKey:nil];
[self.navigationController pushViewController:nextVC animated:NO];
}
我想将此过渡限制为屏幕的已定义矩形。
有没有办法将过渡动画限制为矩形?如果是这样,怎么做?