ivanvorobei / SPStorkController

Now playing controller from Apple Music, Mail & Podcasts Apple's apps.
https://opensource.ivanvorobei.io
MIT License
2.73k stars 204 forks source link

SFSafariViewController preferredStatusBarStyle #61

Open fawzialrifai opened 5 years ago

fawzialrifai commented 5 years ago

Hello Ivan. How can I change preferredStatusBarStyle to .lightContent on SFSafariViewController?

Simulator Screen Shot - iPhone 7 - 2019-04-14 at 15 06 37

ivanvorobei commented 5 years ago

Good day! You read in readme about capture state?

fawzialrifai commented 5 years ago

Sure, I would not ask without read it first. I set preferredStatusBarStyle property and modalPresentationCapturesStatusBarAppearance but that did not work.

ivanvorobei commented 5 years ago

Please, create simple project and send link here. I am tested it.

fawzialrifai commented 5 years ago

https://github.com/fawzirifai/TestingSFSafariViewController

ivanvorobei commented 5 years ago

I am create subclass:

class MyCustomSafariViewController: SFSafariViewController {

    override var preferredStatusBarStyle: UIStatusBarStyle {
        return .lightContent
    }

    override var prefersStatusBarHidden: Bool {
        return false
    }

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        self.setNeedsStatusBarAppearanceUpdate()
    }
}

but it not work. I am tested different way, but for now no result. If I am found how do it, I am write here.

Thanks for your issue.