On iOS 15, when navigating to a view controller that has a transparent navigation bar, the navbar animation isn't working as expected.
It works as expected on iOS versions prior to 15. Please see attached video for iOS 14
Here's a video demonstration:
https://www.dropbox.com/s/80d7qxzhql8fjj2/ios15%20transparent%20navbar%20delay.mov?dl=0
Demo project on Github: https://github.com/karlingen/NavigationTest
This is how I've set up my view controllers:
rootVC
let appearance = UINavigationBarAppearance()
appearance.configureWithDefaultBackground()
appearance.backgroundColor = UIColor.red
self.navigationController?.navigationBar.standardAppearance = appearance
self.navigationController?.navigationBar.scrollEdgeAppearance = self.navigationController?.navigationBar.standardAppearance
firstVC
let appearance = UINavigationBarAppearance()
appearance.configureWithTransparentBackground()
self.navigationController?.navigationBar.standardAppearance = appearance
self.navigationController?.navigationBar.scrollEdgeAppearance = self.navigationController?.navigationBar.standardAppearance
secondVC
let appearance = UINavigationBarAppearance()
appearance.configureWithDefaultBackground()
appearance.backgroundColor = UIColor.yellow
self.navigationController?.navigationBar.standardAppearance = appearance
self.navigationController?.navigationBar.scrollEdgeAppearance = self.navigationController?.navigationBar.standardAppearance
The transition from secondVC to firstVC is smooth (going from yellow to transparent) but not from rootVC to firstVC (going from red to transparent):
Has anyone found a workaround for this?
2
0
8.9k