0
votes

Here is my code:

import UIKit

class TabBarViewController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()
        UITabBar.appearance().barTintColor = UIColor.redColor()
    }
}

When I run this it works perfectly on a real device and sets the color correctly, but when the same code is run on the iPhone simulator the tab bar remains white. I am on iOS 9.2, could this be a bug? Or am I writing the code wrong?

1

1 Answers

0
votes

No, you are not writing the code wrong or iOS 9.2 has such a bug. Because I tried on simulator iOS 9.0 and 9.2, both works correctly with the code you have shared.

Since your real device and my simulator works correctly , the problem could be just Your Simulator so you can try reset Content and Setting of iOS simulator or try to another iOS version.