[Spaces] Show spaces in left panel #4509

- Update title in the navigation bar according to the selected tab
This commit is contained in:
Gil Eluard
2021-07-16 16:20:28 +02:00
parent 5d8eab0cb7
commit 7c4af8f42d
+29 -1
View File
@@ -31,7 +31,7 @@
#import "Riot-Swift.h"
@interface MasterTabBarController () <AuthenticationViewControllerDelegate>
@interface MasterTabBarController () <AuthenticationViewControllerDelegate, UITabBarControllerDelegate>
{
// Array of `MXSession` instances.
NSMutableArray<MXSession*> *mxSessionArray;
@@ -111,6 +111,8 @@
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.delegate = self;
_authenticationInProgress = NO;
// Note: UITabBarViewController shoud not be embed in a UINavigationController (https://github.com/vector-im/riot-ios/issues/3086)
@@ -1272,4 +1274,30 @@
[self.masterTabBarDelegate masterTabBarControllerDidCompleteAuthentication:self];
}
#pragma mark - UITabBarControllerDelegate
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
if ([viewController isKindOfClass:HomeViewController.class])
{
titleLabel.text = NSLocalizedStringFromTable(@"title_home", @"Vector", nil);
}
else if ([viewController isKindOfClass:FavouritesViewController.class])
{
titleLabel.text = NSLocalizedStringFromTable(@"title_favourites", @"Vector", nil);
}
else if ([viewController isKindOfClass:PeopleViewController.class])
{
titleLabel.text = NSLocalizedStringFromTable(@"title_people", @"Vector", nil);
}
else if ([viewController isKindOfClass:RoomsViewController.class])
{
titleLabel.text = NSLocalizedStringFromTable(@"title_rooms", @"Vector", nil);
}
else if ([viewController isKindOfClass:GroupsViewController.class])
{
titleLabel.text = NSLocalizedStringFromTable(@"title_groups", @"Vector", nil);
}
}
@end