Skip to content

Commit

Permalink
Exposed statusBarHeight method.
Browse files Browse the repository at this point in the history
  • Loading branch information
Inferis committed Mar 26, 2012
1 parent 07f768e commit 0926340
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ViewDeck/IIViewDeckController.h
Expand Up @@ -122,6 +122,8 @@ typedef enum {
- (BOOL)rightControllerIsClosed;
- (BOOL)rightControllerIsOpen;

- (CGFloat)statusBarHeight;

@end


Expand Down
11 changes: 8 additions & 3 deletions ViewDeck/IIViewDeckController.m
Expand Up @@ -126,6 +126,7 @@ - (void)setSlidingAndReferenceViews;
- (void)applyShadowToSlidingView;
- (void)restoreShadowToSlidingView;
- (void)arrangeViewsAfterRotation;
- (CGFloat)relativeStatusBarHeight;

- (void)centerViewVisible;
- (void)centerViewHidden;
Expand Down Expand Up @@ -288,13 +289,17 @@ - (CGRect)referenceBounds {
return self.referenceView.bounds;
}

- (CGFloat)statusBarHeight {
- (CGFloat)relativeStatusBarHeight {
if (![self.referenceView isKindOfClass:[UIWindow class]])
return 0;

return [self statusBarHeight];
}

- (CGFloat)statusBarHeight {
return UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)
? [UIApplication sharedApplication].statusBarFrame.size.width
: [UIApplication sharedApplication].statusBarFrame.size.height;
? [UIApplication sharedApplication].statusBarFrame.size.width
: [UIApplication sharedApplication].statusBarFrame.size.height;
}

- (CGRect)centerViewBounds {
Expand Down

0 comments on commit 0926340

Please sign in to comment.