Skip to content

Commit a11f46d

Browse files
committed
Swap tab controllers and set AAChartModel title
Reorder and swap the tab view controllers so AAChartModelListVC becomes the first tab and MainVC becomes the third. Update tab setup in AppDelegate to add secondVC after thirdVC. Configure AAChartModelListVC with a title and a custom tabBarItem using system chart images. Also set self.title = "AAChartModel" in AAChartModelListVC's viewDidLoad to ensure the navigation title is correct.
1 parent f7b9508 commit a11f46d

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

AAChartKitDemo/AppDelegate.m

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -610,12 +610,12 @@ - (UITabBarController *)createTabBarController {
610610

611611
UINavigationController *firstVC = [self createFirstNavigationController];
612612
[viewControllers addObject:firstVC];
613-
614-
UINavigationController *secondVC = [self createSecondNavigationController];
615-
[viewControllers addObject:secondVC];
616-
613+
617614
UINavigationController *thirdVC = [self createThirdNavigationController];
618615
[viewControllers addObject:thirdVC];
616+
617+
UINavigationController *secondVC = [self createSecondNavigationController];
618+
[viewControllers addObject:secondVC];
619619

620620
// UINavigationController *fourthVC = [self createFourthNavigationController];
621621
// [viewControllers addObject:fourthVC];
@@ -644,8 +644,11 @@ - (UIViewController *)createSidebarContainerController {
644644

645645
- (UIViewController *)createFirstViewController {
646646
// 创建第一个视图控制器
647-
MainVC *firstVC = [[MainVC alloc] init];
648-
firstVC.tabBarItem = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemBookmarks tag:0];
647+
AAChartModelListVC *firstVC = [[AAChartModelListVC alloc] init];
648+
firstVC.title = @"AAChartModel";
649+
firstVC.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"AAChartModel"
650+
image:[UIImage systemImageNamed:@"chart.xyaxis.line"]
651+
selectedImage:[UIImage systemImageNamed:@"chart.xyaxis.line"]];
649652

650653
// 在这里添加第一个视图控制器的其他配置
651654

@@ -665,7 +668,7 @@ - (UIViewController *)createSecondViewController {
665668

666669
- (UIViewController *)createThirdViewController {
667670
// 创建第三个视图控制器
668-
AAChartModelListVC *thirdVC = [[AAChartModelListVC alloc] init];
671+
MainVC *thirdVC = [[MainVC alloc] init];
669672
thirdVC.tabBarItem = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:2];
670673

671674
// 在这里添加第三个视图控制器的其他配置

AAChartKitDemo/Demo/AAChartListVC/AAChartModelListVC.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ @implementation AAChartModelListVC
2323
- (void)viewDidLoad {
2424
[super viewDidLoad];
2525
// Do any additional setup after loading the view.
26+
self.title = @"AAChartModel";
2627

2728
self.sectionTitleArr = @[
2829
@"Basic Type---基础类型",

0 commit comments

Comments
 (0)