hey guys! I am using a custom transition animation to transition between view controllers. Here is the code
extension UIViewController {
func presentDetail(_ viewControllerToPresent: UIViewController) {
let transition = CATransition()
transition.duration = 0.3
transition.type = CATransitionType.push
transition.subtype = CATransitionSubtype.fromRight
transition.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
self.view.window?.layer.add(transition, forKey: kCATransition)
present(viewControllerToPresent, animated: false, completion: nil)
}
func dismissDetail() {
let transition = CATransition()
transition.duration = 0.3
transition.type = CATransitionType.push
transition.subtype = CATransitionSubtype.fromLeft
self.view.window?.layer.add(transition, forKey: kCATransition)
dismiss(animated: false, completion: nil)
}
}
sometimes when I am transitioning to the new VC, the contents of the old VC shows up on the new VC for a split second and then refreshes. Can anyone please tell me why this is happening and how to fix this? This happens even on physical devices. The viewDidLoad() in the new VC does not do much either apart from calling a couple of functions.