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

add options to disable snap behavior. #148

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -359,7 +360,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