Fix a problem with dismissing the update view in some scenarios

This commit is contained in:
Andreas Linde 2012-02-05 22:03:24 +01:00
parent 78c45db55a
commit cc3af968f3
3 changed files with 8 additions and 1 deletions

View File

@ -522,11 +522,14 @@ static NSString *kHockeyErrorDomain = @"HockeyErrorDomain";
navController_.modalPresentationStyle = UIModalPresentationFormSheet;
}
hockeyViewController.modalAnimated = YES;
[parentViewController presentModalViewController:navController_ animated:YES];
} else {
// if not, we add a subview to the window. A bit hacky but should work in most circumstances.
// Also, we don't get a nice animation for free, but hey, this is for beta not production users ;)
BWHockeyLog(@"No rootViewController found, using UIWindow-approach: %@", visibleWindow);
hockeyViewController.modalAnimated = NO;
[visibleWindow addSubview:navController_.view];
}
}

View File

@ -44,6 +44,7 @@ typedef enum {
NSDictionary *cellLayout;
BOOL modal_;
BOOL modalAnimated_;
BOOL kvoRegistered_;
BOOL showAllVersions_;
UIStatusBarStyle statusBarStyle_;
@ -59,6 +60,7 @@ typedef enum {
@property (nonatomic, retain) BWHockeyManager *hockeyManager;
@property (nonatomic, readwrite) BOOL modal;
@property (nonatomic, readwrite) BOOL modalAnimated;
- (id)init:(BWHockeyManager *)newHockeyManager modal:(BOOL)newModal;
- (id)init;

View File

@ -50,6 +50,7 @@
@synthesize appStoreButtonState = appStoreButtonState_;
@synthesize hockeyManager = hockeyManager_;
@synthesize modal = modal_;
@synthesize modalAnimated = modalAnimated_;
///////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark -
@ -234,6 +235,7 @@
if ((self = [super initWithStyle:UITableViewStylePlain])) {
self.hockeyManager = newHockeyManager;
self.modal = newModal;
self.modalAnimated = YES;
self.title = BWHockeyLocalize(@"HockeyUpdateScreenTitle");
if ([self.hockeyManager shouldShowUserSettings]) {
@ -280,7 +282,7 @@
}
// If there is no presenting view controller just remove view
if (presentingViewController) {
if (presentingViewController && self.modalAnimated) {
[presentingViewController dismissModalViewControllerAnimated:YES];
}
else {