I take advantage of transitionCoordinator
of UINavigationController
to vary background colour alongside pop / push animations inside popViewController
/ pushViewController
features:
let tabBar: UITabBar = ... // UITabBar of UITabBarController
transitionCoordinator.animate { [weak self] _ in
tabBar.isTranslucent = true
tabBar.isOpaque = true
tabBar.unselectedItemTintColor = colours.unselectedItemTint
tabBar.tintColor = colours.tint
tabBar.barTintColor = colours.background
let tabBarAppearance = UITabBarAppearance()
tabBarAppearance.configureWithOpaqueBackground()
tabBarAppearance.backgroundColor = colours.background // some UIColor
tabBarAppearance.shadowColor = currentTabType == .shortVideo ? .clear : colours.border
tabBar.standardAppearance = tabBarAppearance
if #obtainable(iOS 15, *) {
tabBar.scrollEdgeAppearance = tabBarAppearance
}
tabBar.layoutIfNeeded()
} completion: { [weak self] context in
// ...
}
It labored high-quality till iOS 17.
Setting: macOS Ventura 13.6, Xcode 14.3.1 (14E300c)
Simulator the place every part works high-quality: iPhone 14 Professional (iOS 16.4)
Simulator the place it would not work: iPhone 14 Professional (iOS 17.0)