| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- //
- // TFRootViewController.m
- // RA TradeFiling
- //
- // Created by Rui Zhang on 11/13/20.
- //
- #import "TFRootViewController.h"
- @interface TFRootViewController ()
- @end
- @implementation TFRootViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
-
-
-
-
- // AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
- //
- // LoginViewController * loginVC = [ [UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"LoginPanel"];
- // loginVC.loginSuccessful = ^(void)
- // {
- // appDelegate.isLogin = YES;
- // appDelegate.shouldCheckCache = YES;
- // // 登陆成功后重新刷新tabbar
- // self.viewControllers = self.loginbar;
- // };
- //// loginVC.tabBarItem = [self itemWithSelectedImage:@"login" image:@"login" title:@"login"];
- //// ToolslistViewController* toolVC = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"ToolsPanel"];
- //
- //
- // ToolslistViewController *toolVC=[[ToolslistViewController alloc] initWithNibName:@"StaticModelistViewController" bundle:nil];
- //
- //
- //
- // SearchlistViewController* searchVC = [[SearchlistViewController alloc] initWithNibName:@"StaticModelistViewController" bundle:nil];
- // //[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"SearchPanel"];
- // MylistViewController* myVC = [[MylistViewController alloc] initWithNibName:@"StaticModelistViewController" bundle:nil];
- //
- // myVC.logoutSuccessful = ^(void)
- // {
- // appDelegate.isLogin = NO;
- // // 登陆成功后重新刷新tabbar
- // self.viewControllers = self.logout_bar;
- // };
- // //[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"MyPanel"];
- // OrderHistoryViewController* historyVC = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"HistoryPanel"];
- //// toolVC.tabBarItem = [self itemWithSelectedImage:@"tools" image:@"tools" title:@"tools"];
- // // Do any additional setup after loading the view.
- //
- //
- // self.logout_bar = @[loginVC,toolVC];
- // self.login_bar = @[homeVC,historyVC,searchVC,toolVC,myVC];
- // self.viewControllers = self.logoutbar;
-
-
- //
- // UIImage *logo = [[UIImage imageNamed:@"navigate_logo"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
- // UIBarButtonItem *logoItem = [[UIBarButtonItem alloc] initWithImage:logo landscapeImagePhone:logo style:UIBarButtonItemStylePlain target:nil action:nil];
- // logoItem.enabled = NO;
- // self.tabBarController.navigationItem.leftBarButtonItem = logoItem;
- //
- //
- //
- // UIBarButtonItem *welcomeItem =[[UIBarButtonItem alloc] initWithTitle:[NSString stringWithFormat:@"Welcome: %@",RASingleton.sharedInstance.firstName] menu:nil];
- // welcomeItem.enabled = NO;
- // self.tabBarController.navigationItem.rightBarButtonItem =welcomeItem;
- }
- -(void) setup{
-
- // AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
- //
- LoginViewController * loginVC = [ [UIStoryboard storyboardWithName:@"Login" bundle:nil] instantiateViewControllerWithIdentifier:@"LoginPanel"];
-
- AboutViewController * aboutVC = [ [UIStoryboard storyboardWithName:@"About" bundle:nil] instantiateViewControllerWithIdentifier:@"AboutViewController"];
-
- RAHomeViewController* homeVC = [[UIStoryboard storyboardWithName:@"Home" bundle:nil] instantiateViewControllerWithIdentifier:@"RAHomeViewController"];
-
- MylistViewController* myVC = [[MylistViewController alloc] initWithNibName:@"StaticModelistViewController" bundle:nil];
-
- self.logout_bar = @[loginVC,aboutVC];
- self.login_bar = @[homeVC,myVC,aboutVC]; //homeVC,historyVC,searchVC,toolVC,
- self.viewControllers = self.logout_bar;
-
-
- self.tabBar.tintColor =SecondaryTextColor;
- }
- - (void)handleNotification:(NSNotification *)notification {
-
-
- // NSAssert(true, @"setup does not implement");
-
- // AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
- if ([notification.name isEqualToString:RA_NOTIFICATION_LOGOUT]) {
-
- // [appDelegate Logout];
- // [(LoginViewController *)self.logoutbar.firstObject clear];
- self.viewControllers = self.logout_bar;
- self.selectedIndex = 0;
-
- // [self.navigationController.navigationBar setHidden:true];
- //
- }
- else if ([notification.name isEqualToString:RA_NOTIFICATION_LOGIN])
- {
- // [self.navigationController.navigationBar setHidden:false];
-
-
- self.viewControllers = self.login_bar;
- self.selectedIndex = 0;
- }
- }
- /*
- #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
|