LEONID LEONID - 1 year ago 117
Swift Question

Status bar color: preferredStatusBarStyle doesn't work

Solution I found in stackoverflow - it is override preferredStatusBarStyle in view controller but it's not work for me and i cant understand why. Status bar still black :(

My prerequisites:
Storyboars
Status bar

class ViewController: UIViewController {

@IBOutlet weak var containerView: ContainerView!
@IBOutlet weak var collectionView: UICollectionView!

override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}

override func viewDidLoad() {
super.viewDidLoad()
}
}

Answer Source

First Make Sure These Settings

  1. Project->Target->Deployment Info Project->Target->Developement Info

  2. In info.plist in info.plist

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download