代码整理

This commit is contained in:
eggmanQQQ
2024-11-13 14:21:00 +08:00
parent 4cf14841cf
commit 9a3aab22e9
3 changed files with 19 additions and 178 deletions

View File

@@ -183,18 +183,6 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showAnchorCardKey:) name:kTabShowAnchorCardKey object:nil];
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(switchLanguage:) name:@"kSwitchLanguage" object:nil];
[[ClientConfig shareConfig] setUpdateNormalTabImage:^(UIImage * _Nonnull normalImage, NSInteger index) {
@kStrongify(self);
BaseNavigationController *vc = [self.viewControllers xpSafeObjectAtIndex:index];
vc.tabBarItem.image = [normalImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
}];
[[ClientConfig shareConfig] setUpdateSelectedTabImage:^(UIImage * _Nonnull selectImage, NSInteger index) {
// @kStrongify(self);
// BaseNavigationController *vc = [self.viewControllers xpSafeObjectAtIndex:index];
// vc.tabBarItem.selectedImage = [selectImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
}];
[[ClientConfig shareConfig] setUpdateTabbarBG:^(UIImage * _Nonnull image) {
@kStrongify(self);
[self configTheme:image];
@@ -798,8 +786,8 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
//
[viewControllers addObject:[self createTabBarItem:viewController
title:[[ClientConfig shareConfig] tabName:i]
image:[[ClientConfig shareConfig] _tabNormalImage:i]
selectedImage:[[ClientConfig shareConfig] _tabSelectedImage:i]
image:[[ClientConfig shareConfig] loadDefaultNormalTabImageName:i]
selectedImage:[[ClientConfig shareConfig] loadDefaultSelectedTabImageName:i]
index:i]];
}
//
@@ -810,7 +798,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
if (isLogin) {
for (int i = 0; i < self.viewControllers.count; i++) {
UIViewController *itemVc = self.viewControllers[i];
NSString *urlString = [[ClientConfig shareConfig] tabNormalImage:i];
NSString *urlString = [[ClientConfig shareConfig] loadConfigNormalTabImagePath:i];
if (![urlString hasPrefix:@"http"]) {
continue;
}
@@ -839,7 +827,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
for (int i = 0; i < self.viewControllers.count; i++) {
UIViewController *itemVc = self.viewControllers[i];
NSString *urlString = [[ClientConfig shareConfig] tabSelectedImage:i];
NSString *urlString = [[ClientConfig shareConfig] loadConfigSelectedTabImagePath:i];
if (![urlString hasPrefix:@"http"]) {
continue;
}