RootViewController.m 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. //
  2. // RootViewController.m
  3. // Apex Mobile
  4. //
  5. // Created by Ray on 25/01/2018.
  6. // Copyright © 2018 United Software Applications, Inc. All rights reserved.
  7. //
  8. #import "RootViewController.h"
  9. @interface RootViewController ()
  10. @end
  11. @implementation RootViewController
  12. - (UITabBarItem *)itemWithSelectedImage:(NSString *)selectImage image:(NSString *)image title:(NSString *)title{
  13. UIImage *im = [[UIImage imageNamed:image] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
  14. UITabBarItem *item = [[UITabBarItem alloc] initWithTitle:title image:im selectedImage:im];
  15. return item;
  16. }
  17. - (void)viewDidLoad {
  18. [super viewDidLoad];
  19. [self registForNotification];
  20. // self.automaticallyAdjustsScrollViewInsets = NO;
  21. // self.navigationItem.navi
  22. // [self.navigationController setNavigationBarHidden:YES animated:YES];
  23. // [UIStoryboard storyboardWithName:@"EnumSelectAndSort" bundle:nil]
  24. UIBarButtonItem *backItem = [[UIBarButtonItem alloc] init];
  25. backItem.title = @"Back";
  26. self.navigationItem.backBarButtonItem = backItem;
  27. // tabbar 选中色
  28. // self.tabBar.tintColor = [UIColor blueColor];
  29. // self.tabBar.barTintColor = [UIColor blackColor];
  30. [self setup];
  31. }
  32. -(void) setup
  33. {
  34. NSAssert(true, @"setup does not implement");
  35. }
  36. - (void)didReceiveMemoryWarning {
  37. [super didReceiveMemoryWarning];
  38. // Dispose of any resources that can be recreated.
  39. }
  40. /*
  41. #pragma mark - Navigation
  42. // In a storyboard-based application, you will often want to do a little preparation before navigation
  43. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  44. // Get the new view controller using [segue destinationViewController].
  45. // Pass the selected object to the new view controller.
  46. }
  47. */
  48. - (void)dealloc {
  49. [[NSNotificationCenter defaultCenter] removeObserver:self];
  50. }
  51. - (void)registForNotification {
  52. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNotification:) name:RA_NOTIFICATION_LOGOUT object:nil];
  53. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNotification:) name:RA_NOTIFICATION_LOGIN object:nil];
  54. }
  55. - (void)handleNotification:(NSNotification *)notification {
  56. NSAssert(true, @"setup does not implement");
  57. // AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
  58. // if ([notification.name isEqualToString:RA_NOTIFICATION_LOGOUT]) {
  59. //
  60. //// [appDelegate Logout];
  61. //// [(LoginViewController *)self.logoutbar.firstObject clear];
  62. //// self.viewControllers = self.logoutbar;
  63. //// self.selectedIndex = 0;
  64. ////
  65. // }
  66. // else if ([notification.name isEqualToString:RA_NOTIFICATION_LOGIN])
  67. // {
  68. //
  69. // }
  70. }
  71. @end