From ceffb9dca7acdccc1058c0e669dc747dec080e61 Mon Sep 17 00:00:00 2001 From: Andrea Mazzini Date: Fri, 23 Oct 2015 14:47:24 +0200 Subject: [PATCH] Fix issue #165 --- Source/ScrollingNavigationController.swift | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Source/ScrollingNavigationController.swift b/Source/ScrollingNavigationController.swift index 7286c5e9..68d94011 100644 --- a/Source/ScrollingNavigationController.swift +++ b/Source/ScrollingNavigationController.swift @@ -35,17 +35,23 @@ public class ScrollingNavigationController: UINavigationController, UIGestureRec } /** - Determines wether the scrollbar should scroll when the content inside the scrollview fits + Determines wether the navbar should scroll when the content inside the scrollview fits the view's size. Defaults to `false` */ public var shouldScrollWhenContentFits = false /** - Determines if the scrollbar should expand once the application becomes active after entering background + Determines if the navbar should expand once the application becomes active after entering background Defaults to `true` - */ + */ public var expandOnActive = true + /** + Determines if the navbar scrolling is enabled. + Defaults to `true` + */ + public var scrollingEnabled = true + /** The delegate for the scrolling navbar controller */ @@ -78,6 +84,7 @@ public class ScrollingNavigationController: UINavigationController, UIGestureRec maxDelay = CGFloat(delay) delayDistance = CGFloat(delay) + scrollingEnabled = true } /** @@ -149,6 +156,7 @@ public class ScrollingNavigationController: UINavigationController, UIGestureRec scrollableView = .None gestureRecognizer = .None scrollingNavbarDelegate = .None + scrollingEnabled = false let center = NSNotificationCenter.defaultCenter() center.removeObserver(self, name: UIApplicationDidBecomeActiveNotification, object: nil) @@ -386,7 +394,7 @@ public class ScrollingNavigationController: UINavigationController, UIGestureRec // MARK: - UIGestureRecognizerDelegate public func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWithGestureRecognizer otherGestureRecognizer: UIGestureRecognizer) -> Bool { - return true + return scrollingEnabled } }