Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Sources/SideMenu/SideMenuController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,10 @@ open class SideMenuController: UIViewController {
selector: #selector(SideMenuController.appDidEnteredBackground),
name: UIApplication.didEnterBackgroundNotification,
object: nil)
NotificationCenter.default.addObserver(self,
selector: #selector(SideMenuController.didChangeStatusBarFrame),
name: UIApplication.didChangeStatusBarFrameNotification,
object: nil)
}

private func unregisterNotifications() {
Expand All @@ -492,6 +496,14 @@ open class SideMenuController: UIViewController {
hideMenu(animated: false)
}
}

@objc private func didChangeStatusBarFrame() {
UIView.animate(withDuration: 0.25) {
self.menuContainerView.frame = self.sideMenuFrame(visibility: self.isMenuRevealed)
self.contentContainerView.frame = self.contentFrame(visibility: self.isMenuRevealed)
self.view.layoutIfNeeded()
}
}

// MARK: Status Bar

Expand Down