Thursday, 20 December 2018

How to hide part of status bar, when custom side menu presented

I have a custom Side Menu class based on UIViewController. Presenting of Side menu looks like:

extension UIViewController: MenuPresentableProtocol {

    func setupMenu() {
        guard let menu = AppDelegate.shared.menu else { return }
        menu.view.frame = view.bounds
        view.addSubview(menu.view)
        menu.view.frame.origin.x = -UIScreen.main.bounds.width
    }

}

This means that the appearance of the status bar depends on the current ViewControllers prefersStatusBarHidden property, which in this case is false.

But I need to hide part of the status bar under the side menu. Is there a way for implement this?

This what I have:

When menu hidden, it looks good.

enter image description here

But when menu presents, ...

enter image description here

P.S. I tried to use this answer, but it didn't help me.



from How to hide part of status bar, when custom side menu presented

No comments:

Post a Comment