// // RootViewController.m // Apex Mobile // // Created by Ray on 25/01/2018. // Copyright © 2018 United Software Applications, Inc. All rights reserved. // #import "RootViewController.h" @interface RootViewController () @end @implementation RootViewController - (UITabBarItem *)itemWithSelectedImage:(NSString *)selectImage image:(NSString *)image title:(NSString *)title{ UIImage *im = [[UIImage imageNamed:image] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; UITabBarItem *item = [[UITabBarItem alloc] initWithTitle:title image:im selectedImage:im]; return item; } - (void)viewDidLoad { [super viewDidLoad]; [self registForNotification]; self.automaticallyAdjustsScrollViewInsets = NO; // self.navigationItem.navi // [self.navigationController setNavigationBarHidden:YES animated:YES]; // [UIStoryboard storyboardWithName:@"EnumSelectAndSort" bundle:nil] UIBarButtonItem *backItem = [[UIBarButtonItem alloc] init]; backItem.title = @"Back"; self.navigationItem.backBarButtonItem = backItem; // tabbar 选中色 // self.tabBar.tintColor = [UIColor blueColor]; // self.tabBar.barTintColor = [UIColor blackColor]; [self setup]; } -(void) setup { NSAssert(true, @"setup does not implement"); } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } /* #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. } */ - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; } - (void)registForNotification { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNotification:) name:RA_NOTIFICATION_LOGOUT object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNotification:) name:RA_NOTIFICATION_LOGIN object:nil]; } - (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.logoutbar; //// self.selectedIndex = 0; //// // } // else if ([notification.name isEqualToString:RA_NOTIFICATION_LOGIN]) // { // // } } @end