can anyone help me fix this annoying jump/glitch bug when using a custom transition on view controller to view controller. I can't use push because I want to display the top navigation bar but hide the bottom tab bar so I have had to use a custom transition. I want to acheive a smooth transition like when going from view controller to view controller on a navigation controller. I have attached my code.
func presentDetail(_ viewControllerToPresent: UIViewController) {
let transition = CATransition()
transition.duration = 0.25
transition.type = CATransitionType.push
transition.subtype = CATransitionSubtype.fromRight
self.view.window!.layer.add(transition, forKey: kCATransition)
present(viewControllerToPresent, animated: false)
}
This is not so different from the comments given, however just some explanations that were not easy to add in comments.
I don't think what you see is a glitch, but a
fadethat is automatically applied withCATransition- you can see it slowed down.You could go the
CABasicAnimationor customizing UIViewControllerTransitions CATransition swift iOS but these will be a lot more workI am not sure why
hidesBottomBarWhenPusheddoes not work for you.I have the following view hierarchy:
I now do this:
And this seems to give me what you want: