Skip to content

Commit

Permalink
Disable toggleStatusBar in case the modal view is up.
Browse files Browse the repository at this point in the history
Disable toggleStatusBar in case the modal view is up, and hide the
status bar before opening the modal view if it is open.
  • Loading branch information
steiny2k committed Mar 7, 2012
1 parent 6679765 commit a5b7b25
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions Classes/RootViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,9 @@ - (void)loadModalWebView:(NSURL *) url {
myModalViewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
myModalViewController.delegate = self;

// hide the IndexView before opening modal web view
[self hideStatusBar];

// check if iOS4 or 5
if ([self respondsToSelector:@selector(presentViewController:animated:completion:)])
// iOS 5
Expand Down Expand Up @@ -1506,13 +1509,16 @@ - (void)handleAnchor:(BOOL)animating {

#pragma mark - STATUS BAR
- (void)toggleStatusBar {
NSLog(@"• Toggle status bar visibility");

UIApplication *sharedApplication = [UIApplication sharedApplication];
BOOL hidden = sharedApplication.statusBarHidden;
[sharedApplication setStatusBarHidden:!hidden withAnimation:UIStatusBarAnimationSlide];
if(![indexViewController isDisabled]) {
[indexViewController setIndexViewHidden:!hidden withAnimation:YES];
// if modal view is up, don't toggle.
if (! self.modalViewController) {
NSLog(@"• Toggle status bar visibility");

UIApplication *sharedApplication = [UIApplication sharedApplication];
BOOL hidden = sharedApplication.statusBarHidden;
[sharedApplication setStatusBarHidden:!hidden withAnimation:UIStatusBarAnimationSlide];
if(![indexViewController isDisabled]) {
[indexViewController setIndexViewHidden:!hidden withAnimation:YES];
}
}
}
- (void)hideStatusBar {
Expand Down

0 comments on commit a5b7b25

Please sign in to comment.