dismiss modalviewcontroller from another modalviewcontroller

后端 未结 6 1720
天涯浪人
天涯浪人 2020-12-06 08:15

I am presenting a modalviewcontroller from another modalviewcontroller. When I dismiss the second modalviewcontroller both the first and second modalviewcontroller should ge

6条回答
  •  余生分开走
    2020-12-06 08:59

    Sadly it the view always flick to the first modal in the stack then perform the animation.

    I fixed it with a custom animation:

            let transition: CATransition = CATransition()
            transition.duration = 0.5
            transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
            transition.type = kCATransitionReveal
            transition.subtype = kCATransitionFromBottom
            self.view.window!.layer.add(transition, forKey: nil)
            self.presentingViewController?.presentingViewController?.dismiss(animated: false, completion: nil)
    

提交回复
热议问题