Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 18 tab switch flashes screen

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?

Showing flashing when switching tabs

like image 995
Peter Warbo Avatar asked Jan 01 '26 13:01

Peter Warbo


2 Answers

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)

like image 95
Peter Warbo Avatar answered Jan 03 '26 04:01

Peter Warbo


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.

like image 26
Leszek Szary Avatar answered Jan 03 '26 02:01

Leszek Szary



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!