From e6c9c00db2a5a0cd3db2328e226fa543066f176d Mon Sep 17 00:00:00 2001 From: Erwin Date: Mon, 20 Jun 2016 16:54:31 +0700 Subject: [PATCH] add options to disable snap behavior. --- TLYShyNavBar/TLYShyNavBarManager.h | 5 +++++ TLYShyNavBar/TLYShyNavBarManager.m | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/TLYShyNavBar/TLYShyNavBarManager.h b/TLYShyNavBar/TLYShyNavBarManager.h index 0e507dc..b4a0863 100644 --- a/TLYShyNavBar/TLYShyNavBarManager.h +++ b/TLYShyNavBar/TLYShyNavBarManager.h @@ -76,6 +76,11 @@ */ @property (nonatomic) BOOL disable; +/* Set NO to disable shyNavBar snap behavior + * Defaults to YES + */ +@property (nonatomic) BOOL snap; + /* Use this to be notified about contraction and expansion events. */ @property (nonatomic, weak) id delegate; diff --git a/TLYShyNavBar/TLYShyNavBarManager.m b/TLYShyNavBar/TLYShyNavBarManager.m index d38ea8d..87ebeb2 100644 --- a/TLYShyNavBar/TLYShyNavBarManager.m +++ b/TLYShyNavBar/TLYShyNavBarManager.m @@ -58,6 +58,7 @@ - (instancetype)init self.delegateProxy = [[TLYDelegateProxy alloc] initWithMiddleMan:self]; /* Initialize defaults */ + self.snap = YES; self.contracting = NO; self.previousContractionState = YES; @@ -357,7 +358,9 @@ - (void)_handleScrollingEnded }; self.resistanceConsumed = 0; - [self.navBarController snap:self.contracting completion:completion]; + if (_snap) { + [self.navBarController snap:self.contracting completion:completion]; + } } #pragma mark - KVO