Skip to content
This repository was archived by the owner on Dec 4, 2018. It is now read-only.

Commit e6c9c00

Browse files
committed
add options to disable snap behavior.
1 parent e2eb868 commit e6c9c00

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

TLYShyNavBar/TLYShyNavBarManager.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@
7676
*/
7777
@property (nonatomic) BOOL disable;
7878

79+
/* Set NO to disable shyNavBar snap behavior
80+
* Defaults to YES
81+
*/
82+
@property (nonatomic) BOOL snap;
83+
7984
/* Use this to be notified about contraction and expansion events.
8085
*/
8186
@property (nonatomic, weak) id<TLYShyNavBarManagerDelegate> delegate;

TLYShyNavBar/TLYShyNavBarManager.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ - (instancetype)init
5858
self.delegateProxy = [[TLYDelegateProxy alloc] initWithMiddleMan:self];
5959

6060
/* Initialize defaults */
61+
self.snap = YES;
6162
self.contracting = NO;
6263
self.previousContractionState = YES;
6364

@@ -357,7 +358,9 @@ - (void)_handleScrollingEnded
357358
};
358359

359360
self.resistanceConsumed = 0;
360-
[self.navBarController snap:self.contracting completion:completion];
361+
if (_snap) {
362+
[self.navBarController snap:self.contracting completion:completion];
363+
}
361364
}
362365

363366
#pragma mark - KVO

0 commit comments

Comments
 (0)