SebastianBoldt / Jelly

🌊 - Jelly is a library for animated, non-interactive & interactive viewcontroller transitions and presentations with the focus on a simple and yet flexible API.
http://www.sebastianboldt.com/
MIT License
2.45k stars 123 forks source link

Hide status bar for presented ViewControllers? #40

Closed JohnGroenhof closed 7 years ago

JohnGroenhof commented 7 years ago

@SebastianBoldt, Is there a way to hide the status bar for a presented ViewController, like a slide-in, for example? I've overriden prefersStatusBarHidden in the VC being presented by Jelly, but that's not doing the trick. Any help is appreciated. Thanks for the great tool!

John

SebastianBoldt commented 7 years ago

Hi John, sorry that I answer that late. This actually really ease to accomplish. You just need to define the logic inside the presenting viewController like so.

    override var prefersStatusBarHidden: Bool {
        if let viewController = self.presentedViewController {
                return viewController.prefersStatusBarHidden
        }
        return super.prefersStatusBarHidden
    }