Navigation: Add possibility to instantiate each tab bar item controller programmatically.

This commit is contained in:
SBiOSoftWhare
2021-05-20 21:29:08 +02:00
parent 9570d269b4
commit eefc7c5deb
12 changed files with 56 additions and 1 deletions
@@ -49,4 +49,7 @@
*/
@property (nonatomic) BOOL enableSearchBar;
+ (instancetype)instantiate;
@end
@@ -46,6 +46,13 @@
@implementation GroupsViewController
+ (instancetype)instantiate
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
GroupsViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"GroupsViewController"];
return viewController;
}
- (void)finalizeInit
{
[super finalizeInit];
@@ -208,7 +215,7 @@
}];
[AppDelegate theDelegate].masterTabBarController.navigationItem.title = NSLocalizedStringFromTable(@"title_groups", @"Vector", nil);
[AppDelegate theDelegate].masterTabBarController.tabBar.tintColor = ThemeService.shared.theme.tintColor;
[AppDelegate theDelegate].masterTabBarController.tabBar.tintColor = ThemeService.shared.theme.tintColor;
}
- (void)viewWillDisappear:(BOOL)animated
@@ -21,6 +21,8 @@
*/
@interface FavouritesViewController : RecentsViewController
+ (instancetype)instantiate;
/**
Scroll the next room with missed notifications to the top.
*/
@@ -28,6 +28,13 @@
@implementation FavouritesViewController
+ (instancetype)instantiate
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
FavouritesViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"FavouritesViewController"];
return viewController;
}
- (void)finalizeInit
{
[super finalizeInit];
@@ -25,6 +25,8 @@
*/
@interface UnifiedSearchViewController : SegmentedViewController <UIGestureRecognizerDelegate, ContactsTableViewControllerDelegate>
+ (instancetype)instantiate;
/**
Open the public rooms directory page.
It uses the `publicRoomsDirectoryDataSource` managed by the recents view controller data source
@@ -57,6 +57,13 @@
@implementation UnifiedSearchViewController
+ (instancetype)instantiate
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
UnifiedSearchViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"UnifiedSearchViewController"];
return viewController;
}
- (void)finalizeInit
{
[super finalizeInit];
+2
View File
@@ -22,4 +22,6 @@
*/
@interface HomeViewController : RecentsViewController <UITableViewDataSource, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout>
+ (instancetype)instantiate;
@end
+7
View File
@@ -50,6 +50,13 @@
@implementation HomeViewController
+ (instancetype)instantiate
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
HomeViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"HomeViewController"];
return viewController;
}
- (void)finalizeInit
{
[super finalizeInit];
@@ -22,6 +22,8 @@
*/
@interface PeopleViewController : RecentsViewController <UITableViewDataSource, MXKDataSourceDelegate>
+ (instancetype)instantiate;
/**
Scroll the next room with missed notifications to the top.
*/
@@ -43,6 +43,13 @@
@implementation PeopleViewController
+ (instancetype)instantiate
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
PeopleViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"PeopleViewController"];
return viewController;
}
- (void)finalizeInit
{
[super finalizeInit];
+2
View File
@@ -21,6 +21,8 @@
*/
@interface RoomsViewController : RecentsViewController
+ (instancetype)instantiate;
/**
Scroll the next room with missed notifications to the top.
*/
+7
View File
@@ -34,6 +34,13 @@
@implementation RoomsViewController
+ (instancetype)instantiate
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
RoomsViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"RoomsViewController"];
return viewController;
}
- (void)finalizeInit
{
[super finalizeInit];