Files
keyboard/keyBoard/Class/Base/VC/BaseTabBarController.m

64 lines
2.0 KiB
Mathematica
Raw Normal View History

2025-10-29 14:17:26 +08:00
//
// BaseTabBarController.m
// keyBoard
//
// Created by Mac on 2025/10/29.
//
#import "BaseTabBarController.h"
#import "HomeVC.h"
2025-11-06 16:05:28 +08:00
#import "HomeMainVC.h"
2025-10-29 14:17:26 +08:00
#import "MyVC.h"
2025-10-29 14:28:57 +08:00
#import "BaseNavigationController.h"
#import "KBAuthManager.h"
2025-10-29 14:17:26 +08:00
@interface BaseTabBarController ()
@end
@implementation BaseTabBarController
- (void)viewDidLoad {
[super viewDidLoad];
2025-11-06 16:57:28 +08:00
[self setupTabbarAppearance];
2025-10-29 14:28:57 +08:00
// Setup two tabs: Home & My, each embedded in BaseNavigationController
2025-11-06 16:05:28 +08:00
HomeMainVC *home = [[HomeMainVC alloc] init];
2025-10-29 14:28:57 +08:00
home.title = @"首页";
BaseNavigationController *navHome = [[BaseNavigationController alloc] initWithRootViewController:home];
navHome.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"首页" image:nil selectedImage:nil];
MyVC *my = [[MyVC alloc] init];
my.title = @"我的";
BaseNavigationController *navMy = [[BaseNavigationController alloc] initWithRootViewController:my];
navMy.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"我的" image:nil selectedImage:nil];
self.viewControllers = @[navHome, navMy];
2025-11-06 16:05:28 +08:00
// Token
/*[[KBAuthManager shared] saveAccessToken:@"TEST" refreshToken:nil expiryDate:[NSDate dateWithTimeIntervalSinceNow:3600] userIdentifier:nil]*/;
2025-10-29 14:17:26 +08:00
}
2025-11-06 16:57:28 +08:00
- (void)setupTabbarAppearance{
// TabBar view TabBar
self.tabBar.translucent = NO;
if (@available(iOS 15.0, *)) {
UITabBarAppearance *a = [UITabBarAppearance new];
[a configureWithOpaqueBackground];
a.backgroundColor = [UIColor whiteColor];
self.tabBar.standardAppearance = a;
self.tabBar.scrollEdgeAppearance = a;
}
}
2025-10-29 14:17:26 +08:00
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end