UIApplication.sharedApplication().setStatusBarStyle() deprecated in iOS 9

前端 未结 9 663
野的像风
野的像风 2021-02-01 13:34

I have been using

UIApplication.sharedApplication().setStatusBarStyle()

In my appDelegate and it has worked fine, but since iOS 9, this method

9条回答
  •  梦如初夏
    2021-02-01 14:20

    for those still working with Swift 3 in Xcode 8:

    ( slightly different to Marlon Ruiz's answer above, not an override function, but within viewDidLoad )

    override func viewDidLoad() {
        super.viewDidLoad()
    
        var preferredStatusBarStyle: UIStatusBarStyle {
            return .lightContent
        }
    }
    

提交回复
热议问题