View being blocked by UITransitionView after being presented

后端 未结 6 702
心在旅途
心在旅途 2020-12-28 16:07

I have a side navigation controller and present it via a UIButton. When I make this NC the root view controller directly by [self presentviewcontroller: NC animated: Y

6条回答
  •  不思量自难忘°
    2020-12-28 16:28

    To get tap events through the UITransitionView, set the containerView's userInteractionEnabled to false. This is if you're doing a custom transition animation by using UIViewControllerAnimatedTransitioning.

    Example, in your animateTransition(_:):

    func animateTransition(transitionContext: UIViewControllerContextTransitioning) {
    
        let containerView = transitionContext.containerView
        containerView.isUserInteractionEnabled = false
    
        ...
    }
    

提交回复
热议问题