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?
2
Answers
Temporarily solved it by setting
UIView.setAnimationsEnabled(false)
infunc tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool
And then setting
UIView.setAnimationsEnabled(true)
in functabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController)
Objective-C solution for @PeterWarbo’s Swift solution.