2

There are many posts on this topic, yet I can't find one that works.

I have a View Controller that is not embedded in a Navigation Controller. I would like to change the status bar color to black.

This is my latest attempt How to set Status Bar Style in Swift 3

  1. Change in info.plist the row View controller-based status bar appearance and set it to NO
  2. Change in appDelegate.swift in didFinishLaunchingWithOptions UIApplication.shared.statusBarStyle = .lightContent
Martin Muldoon
  • 3,180
  • 4
  • 21
  • 50

1 Answers1

0
  1. Add "View controller-based status bar appearance" - YES in your info.plist.

  2. Add "Status bar style" - UIStatusBarStyleLightContent in your info.plist if you want the default view controller status bar to be light.

  3. override preferredStatusBarStyle to default/light like so:

    class UIExampleViewController: UIViewController {
    
      override var preferredStatusBarStyle: UIStatusBarStyle {
      return .lightContent
      }
    
    }
    
Joe
  • 8,478
  • 8
  • 35
  • 56
Razzlez
  • 506
  • 5
  • 11