Search code examples
iosios8uinavigationbaruisplitviewcontrolleruistatusbar

How to change Status Bar (Style / Color) of UISplitViewController iOS 8


i am trying to change the status Bar Style of UISplitViewController

i used to do that with UINavigationBar

UINavigationBar.appearance().barStyle = UIBarStyle.Black

but the UISplitViewController does not have an appearance property

is there anyway to change that Style ?


Solution

  • View controller-based status bar appearance is set to YES by default. So you just have to subclass your split controller like

    class SplitViewController: UISplitViewController {
    
        override func preferredStatusBarStyle() -> UIStatusBarStyle {
            return UIStatusBarStyle.BlackOpaque
        }
    
    }