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

Commit

Permalink
Fix appearance when presented in a popover. This reapplies a change f…
Browse files Browse the repository at this point in the history
…rom 2015 which was lost in the refactor to treat status bar height as 0 if in a presenting view controller, and also passes the viewController on to the statusBarController so that it can be used to determine whether that's needed.
  • Loading branch information
Evan D. Schoenberg, M.D committed Aug 23, 2016
1 parent e2eb868 commit 80d5457
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions TLYShyNavBar/ShyControllers/TLYShyStatusBarController.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ static inline CGFloat AACStatusBarHeight(UIViewController *viewController)
}

// Modal views do not overlap the status bar, so no allowance need be made for it
if (viewController.presentingViewController != nil)
{
return 0.f;
}

CGSize statusBarSize = [UIApplication sharedApplication].statusBarFrame.size;
CGFloat statusBarHeight = MIN(statusBarSize.width, statusBarSize.height);

Expand Down
4 changes: 3 additions & 1 deletion TLYShyNavBar/TLYShyNavBarManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

@interface TLYShyNavBarManager () <UIScrollViewDelegate>

@property (nonatomic, strong) id<TLYShyParent> statusBarController;
@property (nonatomic, strong) TLYShyStatusBarController *statusBarController;
@property (nonatomic, strong) TLYShyViewController *navBarController;
@property (nonatomic, strong) TLYShyViewController *extensionController;
@property (nonatomic, strong) TLYShyScrollViewController *scrollViewController;
Expand Down Expand Up @@ -137,6 +137,8 @@ - (void)setViewController:(UIViewController *)viewController

self.navBarController.view = navbar;

self.statusBarController.viewController = viewController;

[self layoutViews];
}

Expand Down

0 comments on commit 80d5457

Please sign in to comment.