Initial commit
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
//
|
||||
// AppDelegate+GiGaConfig.m
|
||||
// GIGA
|
||||
//
|
||||
|
||||
#import "AppDelegate+GiGaConfig.h"
|
||||
#import "GiGaServerConfig.h"
|
||||
#import "GiGaUserViewController.h"
|
||||
#import "GiGaExercisesViewController.h"
|
||||
#import "GiGaBaseNavViewController.h"
|
||||
#import "GiGaMaskTaskViewController.h"
|
||||
#import "GiGaUserDefault.h"
|
||||
@implementation AppDelegate (GiGaConfig)
|
||||
|
||||
-(void)setupTabBarController{
|
||||
|
||||
GiGaExercisesViewController *exerciseVC = [[GiGaExercisesViewController alloc] init];
|
||||
GiGaBaseNavViewController *exerciseNav =[[GiGaBaseNavViewController alloc] initWithRootViewController:exerciseVC];
|
||||
exerciseNav.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor blackColor]};
|
||||
exerciseNav.title = @"测试";
|
||||
exerciseNav.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"测试"
|
||||
image:nil
|
||||
selectedImage:nil];
|
||||
|
||||
GiGaMaskTaskViewController *maskVC = [[GiGaMaskTaskViewController alloc] init];
|
||||
GiGaBaseNavViewController *maskNav =[[GiGaBaseNavViewController alloc] initWithRootViewController:maskVC];
|
||||
maskNav.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor blackColor]};
|
||||
maskNav.title = @"测试2";
|
||||
maskNav.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"测试2"
|
||||
image:nil
|
||||
selectedImage:nil];
|
||||
|
||||
|
||||
GiGaUserViewController *userVC = [[GiGaUserViewController alloc] init];
|
||||
GiGaBaseNavViewController *userNav = [[GiGaBaseNavViewController alloc] initWithRootViewController:userVC];
|
||||
userNav.navigationBar.titleTextAttributes =@{NSForegroundColorAttributeName:[UIColor blackColor]};
|
||||
userNav.title = @"我的";
|
||||
userNav.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"我的" image:nil selectedImage:nil];
|
||||
|
||||
[[UITabBar appearance] setTintColor:GIGARGB(70, 70, 70, 1)];
|
||||
self.rootTabBarVC = [[UITabBarController alloc] init];
|
||||
self.rootTabBarVC.viewControllers = @[exerciseNav,maskNav,userNav];
|
||||
[self initTabItems];
|
||||
self.window.rootViewController = self.rootTabBarVC;
|
||||
self.window.backgroundColor = [UIColor whiteColor];
|
||||
[self.window makeKeyAndVisible];
|
||||
|
||||
}
|
||||
|
||||
-(void)initTabItems{
|
||||
UITabBar *tabBar = self.rootTabBarVC.tabBar;
|
||||
UITabBarItem *item0 = [tabBar.items objectAtIndex:0];
|
||||
UITabBarItem *item1 = [tabBar.items objectAtIndex:1];
|
||||
UITabBarItem *item2 = [tabBar.items objectAtIndex:2];
|
||||
|
||||
item0.selectedImage = [[UIImage imageNamed:@""] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
||||
;
|
||||
item0.image = [[UIImage imageNamed:@""] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
||||
|
||||
item1.selectedImage = [[UIImage imageNamed:@""] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
||||
;
|
||||
item1.image = [[UIImage imageNamed:@""] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
||||
|
||||
item2.selectedImage = [[UIImage imageNamed:@""] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
||||
;
|
||||
item2.image = [[UIImage imageNamed:@""] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)configEnvironment{
|
||||
|
||||
[GiGaServerConfig setServerType:GIGA_ENVIRONMENT];
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
- (void)setupRootVC{
|
||||
GiGaMaskTaskViewController *maskeVC = [[GiGaMaskTaskViewController alloc] init];
|
||||
GiGaBaseNavViewController *maskNav =[[GiGaBaseNavViewController alloc] initWithRootViewController:maskeVC];
|
||||
maskNav.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor blackColor]};
|
||||
maskeVC.title = @"面膜时间";
|
||||
self.window.rootViewController = maskNav;
|
||||
self.window.backgroundColor = [UIColor whiteColor];
|
||||
[self.window makeKeyAndVisible];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user