// // CustomTabbarController.m // Lighting // // Created by 曹云霄 on 16/4/27. // Copyright © 2016年 上海勾芒科技有限公司. All rights reserved. // #import "CustomTabbarController.h" #import "Toolview.h" #import "AppDelegate.h" #import "SceneLibraryViewController.h" #import "ProductLibraryViewController.h" #import "AboutViewController.h" #import "AllCustomerViewController.h" #import "CustomerOrderViewController.h" #import "UserViewController.h" #import "ChangePasswordViewController.h" #import "SearchViewController.h" #import "BaseViewController.h" #import "QRViewController.h" #import "ExperienceCentreViewController.h" #import "RebateViewController.h" #import "GuideIntegralViewController.h" #import "LearningCenterMainViewController.h" #import "AnnouncementViewController.h" @interface CustomTabbarController () @property (nonatomic,strong) NSArray *identifierArray; /** * 保存按钮引用 */ @property (nonatomic,strong) UIButton *Newbutton; /** * 控制器数组 */ @property (nonatomic,strong) NSMutableArray *vcArray; /** * 工具栏 */ @property (nonatomic,strong) Toolview *toolview; @end @implementation CustomTabbarController /** * UIStoryboard Identifier数组 * * @return NSArary */ - (NSArray *)identifierArray { if (_identifierArray == nil) { _identifierArray = [NSArray arrayWithObjects:@"SearchViewController",@"ShoppingViewController",@"ClientViewController",@"RebateViewController",@"GuideIntegralViewController",@"AnnouncementViewController",@"SceneLibraryViewController",@"ProductLibraryViewController",@"AllCustomerViewController",@"CustomerOrderViewController",@"LearningCenterMainViewController",@"AboutViewController", nil]; } return _identifierArray; } - (NSMutableArray *)vcArray { if (!_vcArray) { _vcArray = [NSMutableArray array]; } return _vcArray; } -(void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self.selectedViewController beginAppearanceTransition: YES animated: animated]; } -(void) viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [self.selectedViewController endAppearanceTransition]; } -(void) viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; [self.selectedViewController beginAppearanceTransition: NO animated: animated]; } -(void) viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; [self.selectedViewController endAppearanceTransition]; } - (void)viewDidLoad { [super viewDidLoad]; [self uiConfigAction]; [self addViewcontroller]; } #pragma mark -UI - (void)uiConfigAction { self.tabBar.frame = CGRectMake(ZERO, ZERO, ScreenWidth, NavigationHeight); self.toolview = [[Toolview alloc]initWithFrame:CGRectMake(ZERO, ZERO, ScreenWidth, NavigationHeight)]; self.toolview.delegate = self; self.toolview.inputField.delegate = self; self.delegate = self; [self.tabBar addSubview:self.toolview]; //显示体验中心 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ShowFollowHeart:) name:OPENFOLLOWHEARTVC object:nil]; } #pragma mark -添加controller到viewControllers - (void)addViewcontroller { NSMutableArray *controllerArray = [NSMutableArray array]; UIStoryboard *storyboard = nil; for (int i=0; i