Handle long press on back buttons

This commit is contained in:
aringenbach
2022-06-21 15:09:19 +02:00
committed by aringenbach
parent 1020c981cb
commit e18a58846c
16 changed files with 46 additions and 60 deletions
+11 -5
View File
@@ -112,7 +112,7 @@
[self vc_removeBackTitle];
[self setupTitleView];
titleView.titleLabel.text = [VectorL10n titleHome];
self.titleLabelText = [VectorL10n titleHome];
childViewControllers = [NSMutableArray array];
@@ -278,8 +278,8 @@
}
}
titleView.titleLabel.text = [self getTitleForItemViewController:self.selectedViewController];
self.titleLabelText = [self getTitleForItemViewController:self.selectedViewController];
// Need to be called in case of the controllers have been replaced
[self.selectedViewController viewDidAppear:NO];
}
@@ -299,7 +299,7 @@
NSInteger index = [self indexOfTabItemWithTag:tabBarIndex];
self.selectedIndex = index;
titleView.titleLabel.text = [self getTitleForItemViewController:self.selectedViewController];
self.titleLabelText = [self getTitleForItemViewController:self.selectedViewController];
}
#pragma mark -
@@ -703,6 +703,12 @@
self.navigationItem.titleView = titleView;
}
-(void)setTitleLabelText:(NSString *)text
{
titleView.titleLabel.text = text;
self.navigationItem.backButtonTitle = text;
}
- (void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion
{
// Keep ref on presented view controller
@@ -1038,7 +1044,7 @@
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
titleView.titleLabel.text = [self getTitleForItemViewController:viewController];
self.titleLabelText = [self getTitleForItemViewController:viewController];
}
@end