diff --git a/TLYShyNavBar/ShyControllers/TLYShyScrollViewController.h b/TLYShyNavBar/ShyControllers/TLYShyScrollViewController.h index 594c019..fcd0dc4 100644 --- a/TLYShyNavBar/ShyControllers/TLYShyScrollViewController.h +++ b/TLYShyNavBar/ShyControllers/TLYShyScrollViewController.h @@ -18,6 +18,8 @@ @property (nonatomic, weak) UIRefreshControl *refreshControl; @property (nonatomic, weak) TLYShyViewController *parent; +@property (nonatomic, assign) BOOL hasCustomRefreshControl; + - (CGFloat)updateLayoutIfNeeded; @end diff --git a/TLYShyNavBar/ShyControllers/TLYShyScrollViewController.m b/TLYShyNavBar/ShyControllers/TLYShyScrollViewController.m index bef4fc1..df94004 100644 --- a/TLYShyNavBar/ShyControllers/TLYShyScrollViewController.m +++ b/TLYShyNavBar/ShyControllers/TLYShyScrollViewController.m @@ -36,7 +36,7 @@ - (CGFloat)updateLayoutIfNeeded { CGFloat delta = insets.top - self.scrollView.contentInset.top; - if (self.refreshControl == nil || [self.refreshControl isHidden]) { + if (!self.hasCustomRefreshControl && (self.refreshControl == nil || [self.refreshControl isHidden])) { [self.scrollView tly_setInsets:insets]; } diff --git a/TLYShyNavBar/TLYShyNavBarManager.h b/TLYShyNavBar/TLYShyNavBarManager.h index 43abe81..0e507dc 100644 --- a/TLYShyNavBar/TLYShyNavBarManager.h +++ b/TLYShyNavBar/TLYShyNavBarManager.h @@ -67,6 +67,10 @@ */ @property (nonatomic) TLYShyNavBarFade fadeBehavior; +/* Use this to set if the controller have any kind of custom refresh control + */ +@property (nonatomic) BOOL hasCustomRefreshControl; + /* Set NO to disable shyNavBar behavior temporarily. * Defaults to NO */ diff --git a/TLYShyNavBar/TLYShyNavBarManager.m b/TLYShyNavBar/TLYShyNavBarManager.m index 97f8ec0..591e9f2 100644 --- a/TLYShyNavBar/TLYShyNavBarManager.m +++ b/TLYShyNavBar/TLYShyNavBarManager.m @@ -196,6 +196,18 @@ - (void)setDisable:(BOOL)disable } } +- (void)setHasCustomRefreshControl:(BOOL)hasCustomRefreshControl +{ + if (_hasCustomRefreshControl == hasCustomRefreshControl) + { + return; + } + + _hasCustomRefreshControl = hasCustomRefreshControl; + + self.scrollViewController.hasCustomRefreshControl = hasCustomRefreshControl; +} + - (BOOL)stickyNavigationBar { return self.navBarController.sticky;