0
私のカスタムUIViewControllerAnimatedTransitioningクラスでこの問題に直面しています。アニメーションが完了し、toViewが表示されると、その中の要素(ボタンなど)は相互作用を受け取ることができません。UIViewControllerAnimatedTransitioningを使用すると、toViewボタンが対話できません
カスタムクラスのコードは次のようである:
- (NSTimeInterval)transitionDuration:(id<UIViewControllerContextTransitioning>)transitionContext
{
return 1.0;
}
- (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext;
{
UIViewController *fromViewController = (UIViewController *)[transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
UIViewController *toViewController = (UIViewController *)[transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
CGRect finalFrameForVC = [transitionContext finalFrameForViewController:toViewController];
UIView *containerView = [transitionContext containerView];
CGRect bounds = [[UIScreen mainScreen] bounds];
toViewController.view.frame = CGRectMake(0, 0, bounds.size.width, 0);
[containerView addSubview:toViewController.view];
[UIView animateWithDuration:[self transitionDuration:transitionContext] delay:0.0 usingSpringWithDamping:1.0 initialSpringVelocity:0.0 options:UIViewAnimationOptionCurveLinear animations:^{
fromViewController.view.alpha = 0.5;
toViewController.view.frame = CGRectMake(0, 0, finalFrameForVC.size.width, finalFrameForVC.size.height);
} completion:^(BOOL finished) {
fromViewController.view.alpha = 0.0;
}];
}
、ビューからの移行は、このように呼ばれている:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"showAction"]) {
FiltersViewController *filterView = (FiltersViewController *)segue.destinationViewController;
filterView.transitioningDelegate = self;
}
}
-(id<UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source {
self.filtersPresentAnimationController = [[FiltersPresentAnimationController alloc] init];
return self.filtersPresentAnimationController;
}
私が間違っているの何任意のアイデア?私はsegueからsegue識別子を削除すると、完璧に動作します。