Added delegate method to notify the client when the navigation bar became fully contracted.

This commit is contained in:
Gian Franco Zabarino 2015-05-05 16:59:57 -03:00
parent 2e065ac823
commit 983f632b76
2 changed files with 6 additions and 0 deletions

View File

@ -72,6 +72,7 @@
@optional
- (void)shyNavBarManagerDidBecomeFullyContracted:(TLYShyNavBarManager *) shyNavBarManager;
- (void)shyNavBarManagerDidFinishContracting:(TLYShyNavBarManager *) shyNavBarManager;
- (void)shyNavBarManagerDidFinishExpanding:(TLYShyNavBarManager *) shyNavBarManager;

View File

@ -295,6 +295,11 @@ static inline CGFloat AACStatusBarHeight()
scrollInsets.top = MAX(maxNavY, maxExtensionY);
}
if (!UIEdgeInsetsEqualToEdgeInsets(self.scrollView.scrollIndicatorInsets, scrollInsets)) {
if (scrollInsets.top == AACStatusBarHeight()) {
if ([self.delegate respondsToSelector:@selector(shyNavBarManagerDidBecomeFullyContracted:)]) {
[self.delegate shyNavBarManagerDidBecomeFullyContracted:self];
}
}
self.scrollView.scrollIndicatorInsets = scrollInsets;
}
}