mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
let authenticator set the description of the viewController
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user