diff --git a/Classes/BWHockeyManager.h b/Classes/BWHockeyManager.h index 4a45b20245..654ffa3c60 100644 --- a/Classes/BWHockeyManager.h +++ b/Classes/BWHockeyManager.h @@ -38,9 +38,9 @@ typedef enum { } HockeyAuthorizationState; typedef enum { - HockeyUpdateCheckStartup = 0, - HockeyUpdateCheckDaily = 1, - HockeyUpdateCheckManually = 2 + HockeyUpdateCheckStartup = 0, + HockeyUpdateCheckDaily = 1, + HockeyUpdateCheckManually = 2 } HockeyUpdateSetting; @protocol BWHockeyManagerDelegate; @@ -48,48 +48,54 @@ typedef enum { @class BWApp; @interface BWHockeyManager : NSObject { - id delegate_; - NSArray *apps_; - - NSString *updateURL_; - NSString *appIdentifier_; - NSString *currentAppVersion_; - - UINavigationController *navController_; - BWHockeyViewController *currentHockeyViewController_; - UIView *authorizeView_; - - NSMutableData *receivedData_; - - BOOL loggingEnabled_; - BOOL checkInProgress_; - BOOL dataFound; - BOOL updateAvailable_; - BOOL showFeedback_; - BOOL updateURLOffline_; - BOOL updateAlertShowing_; - BOOL lastCheckFailed_; - - BOOL isAppStoreEnvironment_; - - NSURLConnection *urlConnection_; - NSDate *lastCheck_; - NSDate *usageStartTimestamp_; - - BOOL sendUserData_; - BOOL sendUsageTime_; - BOOL allowUserToDisableSendData_; - BOOL userAllowsSendUserData_; - BOOL userAllowsSendUsageTime_; - BOOL showUpdateReminder_; - BOOL checkForUpdateOnLaunch_; - HockeyComparisonResult compareVersionType_; - HockeyUpdateSetting updateSetting_; - BOOL showUserSettings_; - BOOL showDirectInstallOption_; - - BOOL requireAuthorization_; - NSString *authenticationSecret_; + id delegate_; + NSArray *apps_; + + NSString *updateURL_; + NSString *appIdentifier_; + NSString *currentAppVersion_; + + UINavigationController *navController_; + BWHockeyViewController *currentHockeyViewController_; + UIView *authorizeView_; + + NSMutableData *receivedData_; + + BOOL loggingEnabled_; + BOOL checkInProgress_; + BOOL dataFound; + BOOL updateAvailable_; + BOOL showFeedback_; + BOOL updateURLOffline_; + BOOL updateAlertShowing_; + BOOL lastCheckFailed_; + + BOOL isAppStoreEnvironment_; + + NSURLConnection *urlConnection_; + NSDate *lastCheck_; + NSDate *usageStartTimestamp_; + + BOOL sendUserData_; + BOOL sendUsageTime_; + BOOL allowUserToDisableSendData_; + BOOL userAllowsSendUserData_; + BOOL userAllowsSendUsageTime_; + BOOL showUpdateReminder_; + BOOL checkForUpdateOnLaunch_; + HockeyComparisonResult compareVersionType_; + HockeyUpdateSetting updateSetting_; + BOOL showUserSettings_; + BOOL showDirectInstallOption_; + + BOOL requireAuthorization_; + NSString *authenticationSecret_; + + BOOL checkForTracker_; + NSDictionary *trackerConfig_; + + UIBarStyle barStyle_; + UIModalPresentationStyle modalPresentationStyle_; } /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -145,6 +151,12 @@ typedef enum { // if NO, the user can not change it, and the default or developer defined value will be used @property (nonatomic, assign, getter=shouldShowUserSettings) BOOL showUserSettings; +// set bar style of navigation controller +@property (nonatomic, assign) UIBarStyle barStyle; + +// set modal presentation style of update view +@property (nonatomic, assign) UIModalPresentationStyle modalPresentationStyle; + // if YES, then an update check will be performed after the application becomes active (default) // if NO, then the update check will not happen unless invoked explicitly @property (nonatomic, assign, getter=isCheckForUpdateOnLaunch) BOOL checkForUpdateOnLaunch; diff --git a/Classes/BWHockeyManager.m b/Classes/BWHockeyManager.m index 44c7e99abb..b02c3b52b6 100644 --- a/Classes/BWHockeyManager.m +++ b/Classes/BWHockeyManager.m @@ -81,8 +81,6 @@ static NSString *kHockeyErrorDomain = @"HockeyErrorDomain"; @implementation BWHockeyManager -@synthesize checkForTracker; -@synthesize trackerConfig; @synthesize delegate = delegate_; @synthesize updateURL = updateURL_; @synthesize appIdentifier = appIdentifier_; @@ -110,6 +108,10 @@ static NSString *kHockeyErrorDomain = @"HockeyErrorDomain"; @synthesize authenticationSecret = authenticationSecret_; @synthesize authorizeView = authorizeView_; @synthesize isAppStoreEnvironment = isAppStoreEnvironment_; +@synthesize checkForTracker = checkForTracker_; +@synthesize trackerConfig = trackerConfig_; +@synthesize barStyle = barStyle_; +@synthesize modalPresentationStyle = modalPresentationStyle_; /////////////////////////////////////////////////////////////////////////////////////////////////// #pragma mark - @@ -383,6 +385,8 @@ static NSString *kHockeyErrorDomain = @"HockeyErrorDomain"; self.checkForUpdateOnLaunch = YES; self.showUserSettings = YES; self.compareVersionType = HockeyComparisonResultGreater; + self.barStyle = UIBarStyleDefault; + self.modalPresentationStyle = UIModalPresentationFormSheet; // load update setting from user defaults and check value if ([[NSUserDefaults standardUserDefaults] objectForKey:kHockeyAutoUpdateSetting]) { @@ -496,6 +500,8 @@ static NSString *kHockeyErrorDomain = @"HockeyErrorDomain"; BWHockeyViewController *hockeyViewController = [self hockeyViewController:YES]; navController_ = [[UINavigationController alloc] initWithRootViewController:hockeyViewController]; + navController_.navigationBar.barStyle = barStyle_; + navController_.modalPresentationStyle = modalPresentationStyle_; if (parentViewController) { if ([navController_ respondsToSelector:@selector(setModalTransitionStyle:)]) { diff --git a/Classes/CNSHockeyManager.h b/Classes/CNSHockeyManager.h index 6f8699748f..0f476af4e9 100644 --- a/Classes/CNSHockeyManager.h +++ b/Classes/CNSHockeyManager.h @@ -145,6 +145,16 @@ // Default: YES @property (nonatomic, assign, getter=shouldShowUserSettings) BOOL showUserSettings; +// Set bar style of navigation controller +// +// Default: UIBarStyleDefault +@property (nonatomic, assign) UIBarStyle barStyle; + +// Set modal presentation style of update view +// +// Default: UIModalPresentationStyleFormSheet +@property (nonatomic, assign) UIModalPresentationStyle modalPresentationStyle; + // Allow the user to disable the sending of user data; this settings should // only be set if showUserSettings is enabled. // diff --git a/Classes/CNSHockeyManager.m b/Classes/CNSHockeyManager.m index 55b4b01028..c6c99acac9 100644 --- a/Classes/CNSHockeyManager.m +++ b/Classes/CNSHockeyManager.m @@ -227,6 +227,22 @@ [[BWHockeyManager sharedHockeyManager] setShowUserSettings:showUserSettings]; } +- (UIBarStyle)barStyle { + return [[BWHockeyManager sharedHockeyManager] barStyle]; +} + +- (void)setBarStyle:(UIBarStyle)barStyle { + [[BWHockeyManager sharedHockeyManager] setBarStyle:barStyle]; +} + +- (UIModalPresentationStyle)modalPresentationStyle { + return [[BWHockeyManager sharedHockeyManager] modalPresentationStyle]; +} + +- (void)setModalPresentationStyle:(UIModalPresentationStyle)modalPresentationStyle { + [[BWHockeyManager sharedHockeyManager] setModalPresentationStyle:modalPresentationStyle]; +} + - (BOOL)isUserAllowedToDisableSendData { return [[BWHockeyManager sharedHockeyManager] isAllowUserToDisableSendData]; }