Resolved: bottom toolbar is black on iOS 15 and above

In this post, we will see how to resolve bottom toolbar is black on iOS 15 and above

Question:

An old client asked me to make some minor updates to his app. Compiling for iOS 15 and above, the bottom toolbar is now black (after momentarily flashing the original intended color). I had the same problem with the navigation bar, and fixed that with the below code, but the bottom toolbar is still problematic. (This app was written a long time ago so is in Objective C, but I would be grateful for answers in either Objective C or Swift).
I thought to do something similar using UIToolbarAppearance, but couldn’t make it work. This is what I tried:
Thanks for any help.

Best Answer:

In accordance with Matt’s comment above, I set all four appearances for the toolbar:
(CommonColors is my own custom class for converting colors, but any of the standard ways of getting a UIColor could be used).

If you have better answer, please add a comment about this, thank you!

Source: Stackoverflow.com