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

Commit

Permalink
fixes #93 .. As far as I can tell
Browse files Browse the repository at this point in the history
  • Loading branch information
Mazyod committed Oct 21, 2015
1 parent ff67d2b commit baffc6f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
14 changes: 12 additions & 2 deletions TLYShyNavBar/TLYShyNavBarManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ @interface TLYShyStatusBarController : NSObject <TLYShyViewControllerParent>

@implementation TLYShyStatusBarController

- (CGFloat)viewMaxY
- (CGFloat)_statusBarHeight
{
CGFloat statusBarHeight = AACStatusBarHeight(self.viewController);
/* The standard status bar is 20 pixels. The navigation bar extends 20 pixels up so it is overlapped by the status bar.
Expand All @@ -87,6 +87,16 @@ - (CGFloat)viewMaxY
return statusBarHeight;
}

- (CGFloat)viewMaxY
{
return [self _statusBarHeight];
}

- (CGFloat)calculateTotalHeightRecursively
{
return [self _statusBarHeight];
}

@end


Expand Down Expand Up @@ -417,7 +427,7 @@ - (void)prepareForDisplay
- (void)layoutViews
{
UIEdgeInsets scrollInsets = self.scrollView.contentInset;
scrollInsets.top = self.extensionController.viewMaxY;
scrollInsets.top = [self.extensionController calculateTotalHeightRecursively];

if (UIEdgeInsetsEqualToEdgeInsets(scrollInsets, self.previousScrollInsets))
{
Expand Down
4 changes: 3 additions & 1 deletion TLYShyNavBar/TLYShyViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ typedef NS_ENUM(NSInteger, TLYShyNavViewControllerFade) {

@property (nonatomic, readonly) CGFloat viewMaxY;

- (CGFloat)calculateTotalHeightRecursively;

@end

/* CLASS DESCRIPTION:
Expand Down Expand Up @@ -56,8 +58,8 @@ typedef NS_ENUM(NSInteger, TLYShyNavViewControllerFade) {
*/
@property (nonatomic) BOOL sticky;

- (CGFloat)updateYOffset:(CGFloat)deltaY;
- (void)offsetCenterBy:(CGPoint)deltaPoint;
- (CGFloat)updateYOffset:(CGFloat)deltaY;

- (CGFloat)snap:(BOOL)contract;

Expand Down
5 changes: 5 additions & 0 deletions TLYShyNavBar/TLYShyViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ - (CGFloat)viewMaxY
return CGRectGetMaxY(self.view.frame);
}

- (CGFloat)calculateTotalHeightRecursively
{
return CGRectGetHeight(self.view.bounds) + [self.parent calculateTotalHeightRecursively];
}

@end


Expand Down

0 comments on commit baffc6f

Please sign in to comment.