diff --git a/Classes/BITAuthenticationViewController.h b/Classes/BITAuthenticationViewController.h index 9df4b0ae20..ef11f01dda 100644 --- a/Classes/BITAuthenticationViewController.h +++ b/Classes/BITAuthenticationViewController.h @@ -47,6 +47,12 @@ */ @property (nonatomic, assign) BOOL showsLoginViaWebButton; +/** + * Description shown on top of view. Should tell why this view + * was presented and what's next. + */ +@property (nonatomic, copy) NSString* tableViewTitle; + /** * can be set to YES to also require the users password * diff --git a/Classes/BITAuthenticationViewController.m b/Classes/BITAuthenticationViewController.m index d08aa5d9c6..689eed4030 100644 --- a/Classes/BITAuthenticationViewController.m +++ b/Classes/BITAuthenticationViewController.m @@ -142,6 +142,13 @@ _emailField.text = email; } } + +- (void)setTableViewTitle:(NSString *)viewDescription { + _tableViewTitle = [viewDescription copy]; + if(self.isViewLoaded) { + [self.tableView reloadData]; + } +} #pragma mark - UIViewController Rotation - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation { @@ -181,13 +188,7 @@ - (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section { if (section == 0) { - if(self.showsLoginViaWebButton) { - return BITHockeyLocalizedString(@"HockeyAuthenticationViewControllerWebLoginDescription"); - } else if(self.requirePassword) { - return BITHockeyLocalizedString(@"HockeyAuthenticationViewControllerDataEmailAndPasswordDescription"); - } else { - return BITHockeyLocalizedString(@"HockeyAuthenticationViewControllerDataEmailDescription"); - } + return self.tableViewTitle; } return nil; diff --git a/Classes/BITAuthenticator.m b/Classes/BITAuthenticator.m index fffebf9eda..eae815de04 100644 --- a/Classes/BITAuthenticator.m +++ b/Classes/BITAuthenticator.m @@ -172,11 +172,14 @@ static NSString* const kBITAuthenticatorAuthTokenTypeKey = @"BITAuthenticatorAut case BITAuthenticatorIdentificationTypeHockeyAppUser: viewController = [[BITAuthenticationViewController alloc] initWithDelegate:self]; viewController.requirePassword = YES; + viewController.tableViewTitle = BITHockeyLocalizedString(@"HockeyAuthenticationViewControllerDataEmailAndPasswordDescription"); break; case BITAuthenticatorIdentificationTypeDevice: viewController = [[BITAuthenticationViewController alloc] initWithDelegate:self]; viewController.requirePassword = NO; viewController.showsLoginViaWebButton = YES; + viewController.tableViewTitle = BITHockeyLocalizedString(@"HockeyAuthenticationViewControllerWebLoginDescription"); + break; break; case BITAuthenticatorIdentificationTypeHockeyAppEmail: if(nil == self.authenticationSecret) { @@ -188,6 +191,7 @@ static NSString* const kBITAuthenticatorAuthTokenTypeKey = @"BITAuthenticatorAut } viewController = [[BITAuthenticationViewController alloc] initWithDelegate:self]; viewController.requirePassword = NO; + viewController.tableViewTitle = BITHockeyLocalizedString(@"HockeyAuthenticationViewControllerDataEmailDescription"); break; }