introduce disabled flag

This commit is contained in:
Aleksey Kozhevnikov 2015-01-06 22:11:05 +03:00
parent b1bee69762
commit 32225901be
2 changed files with 21 additions and 0 deletions

View File

@ -52,6 +52,8 @@
*/
@property (nonatomic, getter = isAlphaFadeEnabled) BOOL alphaFadeEnabled;
@property (nonatomic) BOOL disable;
@end

View File

@ -171,10 +171,29 @@ static inline CGFloat AACStatusBarHeight()
return self.viewController.isViewLoaded && self.viewController.view.window;
}
- (void)setDisable:(BOOL)disable
{
if (disable == _disable)
{
return;
}
_disable = disable;
if (!disable) {
self.previousYOffset = self.scrollView.contentOffset.y;
}
}
#pragma mark - Private methods
- (BOOL)_shouldHandleScrolling
{
if (self.disable)
{
return NO;
}
CGRect scrollFrame = UIEdgeInsetsInsetRect(self.scrollView.bounds, self.scrollView.contentInset);
CGFloat scrollableAmount = self.scrollView.contentSize.height - CGRectGetHeight(scrollFrame);
BOOL scrollViewIsSuffecientlyLong = (scrollableAmount > self.navBarController.totalHeight);