Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 667
Amr Mohamed Avatar asked Jan 25 '15 15:01

Amr Mohamed


1 Answers

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
    }

}
like image 156
Petr Syrov Avatar answered Sep 28 '22 07:09

Petr Syrov