I just noticed when building my app with Xcode 16 (iOS 18) that the screen flashes briefly when switching tabs (using a standard UITabBarController). Have any one of you experienced it? I have searched documentation and can not find anything mentioning changes in the behaviour. I also tried implementing the following methods of UITabBarControllerDelegate:
func tabBarController(_ tabBarController: UITabBarController, animationControllerForTransitionFrom fromVC: UIViewController, to toVC: UIViewController) -> (any UIViewControllerAnimatedTransitioning)? {
nil
}
func tabBarController(_ tabBarController: UITabBarController, interactionControllerFor animationController: any UIViewControllerAnimatedTransitioning) -> (any UIViewControllerInteractiveTransitioning)? {
nil
}
How can I get rid of the flashing?

Temporarily solved it by setting UIView.setAnimationsEnabled(false) in func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool
And then setting UIView.setAnimationsEnabled(true) in func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController)
To fix the flicker without removing the animation you can try adding this in your view controller viewDidLoad function:
tabBarController?.view.backgroundColor = .clear
It worked in my case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With