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

Commit

Permalink
add options to disable snap behavior.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwinzhang committed Jun 20, 2016
1 parent e2eb868 commit e6c9c00
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions TLYShyNavBar/TLYShyNavBarManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<TLYShyNavBarManagerDelegate> delegate;
Expand Down
5 changes: 4 additions & 1 deletion TLYShyNavBar/TLYShyNavBarManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ - (instancetype)init
self.delegateProxy = [[TLYDelegateProxy alloc] initWithMiddleMan:self];

/* Initialize defaults */
self.snap = YES;
self.contracting = NO;
self.previousContractionState = YES;

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e6c9c00

Please sign in to comment.