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

Commit

Permalink
Merge pull request #134 from arielpollack/master
Browse files Browse the repository at this point in the history
Ability to use custom pull to refresh controls
  • Loading branch information
Mazyod committed May 16, 2016
2 parents c9df95a + fadc4d2 commit c8b056d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions TLYShyNavBar/ShyControllers/TLYShyScrollViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
@property (nonatomic, weak) UIRefreshControl *refreshControl;
@property (nonatomic, weak) TLYShyViewController *parent;

@property (nonatomic, assign) BOOL hasCustomRefreshControl;

- (CGFloat)updateLayoutIfNeeded;

@end
2 changes: 1 addition & 1 deletion TLYShyNavBar/ShyControllers/TLYShyScrollViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down
4 changes: 4 additions & 0 deletions TLYShyNavBar/TLYShyNavBarManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
12 changes: 12 additions & 0 deletions TLYShyNavBar/TLYShyNavBarManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c8b056d

Please sign in to comment.