Skip to content

Commit

Permalink
Fix #313
Browse files Browse the repository at this point in the history
  • Loading branch information
andreamazz committed Apr 20, 2018
1 parent c82e4ba commit 24e3bc6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/ScrollingNavigationController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ open class ScrollingNavigationController: UINavigationController, UIGestureRecog

func didRotate(_ notification: Notification) {
let newOrientation = UIDevice.current.orientation
if (previousOrientation.isPortrait && newOrientation.isLandscape) || (previousOrientation.isLandscape && newOrientation.isPortrait) {
// Show the navbar if the orantation is the same (the app just got back from background) or if there is a switch between portrait and landscape (and vice versa)
if (previousOrientation == newOrientation) || (previousOrientation.isPortrait && newOrientation.isLandscape) || (previousOrientation.isLandscape && newOrientation.isPortrait) {
showNavbar()
}
previousOrientation = newOrientation
Expand Down

0 comments on commit 24e3bc6

Please sign in to comment.