I am presenting a modalviewcontroller from another modalviewcontroller. When I dismiss the second modalviewcontroller both the first and second modalviewcontroller should ge
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)