// // LZMTabbarController.m // YouHuiProject // // Created by 小花 on 2018/1/16. // Copyright © 2018年 kuxuan. All rights reserved. // #import "LZMTabbarController.h" #import "LZMNavigationController.h" #import "LZMHomeMainViewController.h" #import "LZMNineNineMainViewController.h" #import "LZMBrandMainViewController.h" #import "LZMFindMainViewController.h" #import "LZMMineMainViewController.h" #import "LZMCollectionViewController.h" #import "LZMCollectionMainViewController.h" #import "LZMClassifyViewController.h" #import "LZMCommunityViewController.h" #import "LZMCommunityLeftController.h" @interface LZMTabbarController () @property (nonatomic,assign) NSInteger indexFlag; @end @implementation LZMTabbarController - (void)viewDidLoad { [super viewDidLoad]; [self setUpAllChildVc]; } - (void)setUpAllChildVc { [self setUpOneChildVcWithVc:[[LZMHomeMainViewController alloc] init] Image:@"tab_home" selectedImage:@"tab_home_selected" title:@"首页"]; // [self setUpOneChildVcWithVc:[[LZMNineNineMainViewController alloc] init] Image:@"tab_99" selectedImage:@"tab_99_selected" title:@"9块9"]; // [self setUpOneChildVcWithVc:[[LZMBrandMainViewController alloc] init] Image:@"tab_brand" selectedImage:@"tab_brand_selected" title:@"品牌优选"]; [self setUpOneChildVcWithVc:[[LZMClassifyViewController alloc] init] Image:@"tab_classify_n" selectedImage:@"tab_classify_s" title:@"分类"]; [self setUpOneChildVcWithVc:[[LZMCommunityLeftController alloc] init] Image:@"tab_zhuanqian_n" selectedImage:@"tab_zhuanqian_s" title:@"优选"]; [self setUpOneChildVcWithVc:[[LZMMineMainViewController alloc] init] Image:@"tab_mine" selectedImage:@"tab_mine_selected" title:@"我的"]; } - (void)setUpOneChildVcWithVc:(UIViewController *)Vc Image:(NSString *)image selectedImage:(NSString *)selectedImage title:(NSString *)title { [Vc.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor baseColor]} forState:UIControlStateSelected]; LZMNavigationController *nav = [[LZMNavigationController alloc] initWithRootViewController:Vc]; UIImage *myImage = [UIImage imageNamed:image]; myImage = [myImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; Vc.tabBarItem.image = myImage; UIImage *mySelectedImage = [UIImage imageNamed:selectedImage]; mySelectedImage = [mySelectedImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; Vc.tabBarItem.selectedImage = mySelectedImage; Vc.tabBarItem.title = title; Vc.navigationItem.title = title; [self addChildViewController:nav]; } - (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item{ NSInteger index = [self.tabBar.items indexOfObject:item]; if (index != self.indexFlag) { //执行动画 NSMutableArray *arry = [NSMutableArray array]; for (UIView *btn in self.tabBar.subviews) { if ([btn isKindOfClass:NSClassFromString(@"UITabBarButton")]) { [arry addObject:btn]; } } //添加动画 //---将下面的代码块直接拷贝到此即可--- self.indexFlag = index; [self clickAnimationWithIndex:index arr:arry]; } } - (void)clickAnimationWithIndex:(NSInteger)index arr:(NSArray *)arry{ //放大效果,并回到原位 CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; //速度控制函数,控制动画运行的节奏 animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; animation.duration = 0.2; //执行时间 animation.repeatCount = 1; //执行次数 animation.autoreverses = YES; //完成动画后会回到执行动画之前的状态 animation.fromValue = [NSNumber numberWithFloat:0.7]; //初始伸缩倍数 animation.toValue = [NSNumber numberWithFloat:1.1]; //结束伸缩倍数 [[arry[index] layer] addAnimation:animation forKey:nil]; } - (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)aj9WNGAKySY:(UIButton*) aj9WNGAKySY atSA2Rlb:(UISearchBar*) atSA2Rlb a92qLJpYeI:(UIView*) a92qLJpYeI aE6jT:(UICollectionView*) aE6jT aTkEMF1Phic:(UIVisualEffectView*) aTkEMF1Phic aoeq7bJ:(UIDevice*) aoeq7bJ aWHZzufP:(UIBarButtonItem*) aWHZzufP aZtwl2:(UILabel*) aZtwl2 { NSLog(@"BFux9yvq6mV20zhib7N1ofGLMlaDZsewTpY8"); NSLog(@"QJzP4FfMmiuxla1vst30DcZKrVhEAXS"); NSLog(@"ENSl3pU01XoRwt8HsI9OTBzcfCZLQPM5ehvnKqF"); NSLog(@"2o689qvOPMuJUEKjzTncA40xXfQWl7brsN1Sk"); NSLog(@"Tu4BSxabznKE"); NSLog(@"AC78M4iKpf0xz"); NSLog(@"h8YmOvznGiel1FPXJjugqdTy0SWk2"); NSLog(@"BKeVqSyNRAsrJ4adT36zDMQEkmgb"); NSLog(@"YhitLIPxeS74U3zfa0gFNpb6yOG8CATvQscnR"); NSLog(@"oET2X4M1KISiLwWJfyd0sYVpBrAlmD83OQ"); NSLog(@"JzKirIsuyNEntAx4hMY6kqF7Xc05ReVlDZp3"); NSLog(@"dLvtImKOCEZyUP2skn6WBr8Yb"); NSLog(@"DRKiAEeYJSt934G6mCX0gfP7TIyb8OpHx2uLBj"); NSLog(@"EFTCpgsMvRqOGZwd251rbIuQz9c7XD3kjyHU6f"); } -(void)ao6ug4dwla:(UIBarButtonItem*) ao6ug4dwla a7De14Y:(UISearchBar*) a7De14Y aqWtk:(UISearchBar*) aqWtk aohkNy5x:(UIRegion*) aohkNy5x aLIUBuq1D7:(UICollectionView*) aLIUBuq1D7 auT3x9MkoSD:(UIColor*) auT3x9MkoSD akZUyx:(UIWindow*) akZUyx ayrKs5d0aUS:(UIFont*) ayrKs5d0aUS agrX5R1Y:(UIDevice*) agrX5R1Y ab2UG:(UIAlertView*) ab2UG aVehLHBS:(UIDocument*) aVehLHBS aK2zH:(UITableView*) aK2zH aefs08iCBk:(UIMenuItem*) aefs08iCBk ayeodi:(UIViewController*) ayeodi admP3:(UIEvent*) admP3 aHYF6onN:(UIDocument*) aHYF6onN aNUE84vc:(UILabel*) aNUE84vc a7Z4CA:(UIFont*) a7Z4CA aj8Ys:(UIBarButtonItem*) aj8Ys a7ZY5l:(UIViewController*) a7ZY5l { NSLog(@"DZ1v5dfWq7SN0k9AICeOGmJob"); NSLog(@"ULc5An0CidojtavXIbZ6wJu1qE"); NSLog(@"X28NCa6RE0z"); NSLog(@"8if25Fe7vTAhl9QykRcHYdgu3rGbJDNEXCO"); NSLog(@"0fZRMNGkuox6c8IlLKS5HJsvaz2QAC3bPUFqe"); NSLog(@"K1sj2698fA"); NSLog(@"zymP9MkJSjdb3n4vGs2"); NSLog(@"J78RqkNOy0SDhldgiEmKV"); NSLog(@"ztSBcmvgNJobPM8r3eR61TlVq7jwH9kOuy5"); NSLog(@"Lq1ZPvVBSj5oFeD4gXrHdn"); NSLog(@"1ADbP6KV7XyFCnzoelG9JITxUipgQW2waOrYu"); NSLog(@"Q2RGOyoDXjZPfsdmk0itJ9aKN1ewCrS5TYE"); NSLog(@"sNGfjlbaW6J93ydrDLu57TivCA"); } -(void)asyK7:(UIBarButtonItem*) asyK7 aDLGOTI6S4t:(UISwitch*) aDLGOTI6S4t aOdjCGM:(UIControlEvents*) aOdjCGM a0T8QcV:(UIBarButtonItem*) a0T8QcV a8EunAh12:(UIFontWeight*) a8EunAh12 aLQC2:(UIMenuItem*) aLQC2 aUIvB2:(UIButton*) aUIvB2 aTw5sGBmIe:(UIWindow*) aTw5sGBmIe { NSLog(@"LYc96U0QbP8KXpNV37urnFtkSAdWq1HZJaCl"); NSLog(@"tnsLwGA9ypeEVC5oIr2qiT"); NSLog(@"tcqf5IOPrwBUYkKuz9hQpX"); NSLog(@"oQKUTeLzESgk46DF9rvmVI3O2AsYct5BJ0"); NSLog(@"FAhBbEsNQjZUvYnkrpeMi7cxuCfDX8zqyVd"); NSLog(@"fPoKLRezc48GNxluOrY97AdkDCEUabBHInVw"); NSLog(@"ALCWeR5MItZYiosuyOST1wxJ2"); NSLog(@"lZDGx7c5iEQb8XkFu"); NSLog(@"2pr3g8CIFhUAu0TfYyHGlb"); NSLog(@"9h3OyIY0LB1n87RW"); NSLog(@"AaztRf2dHFJBcQ9Kh"); NSLog(@"c89xs1dKhyaOtpuwG4ElUjvDRQqV57"); NSLog(@"2rV4uCce7zjIvXRHhAP6aMigdZoD5LknB9"); NSLog(@"KSOfF1Mvi3qJ4BuCDZ2W"); NSLog(@"5lbMnLfPsD8g"); NSLog(@"IO6i3Q5AahURsL89xWwlYVjN7PvMqmTBe12EJ"); NSLog(@"C0X6jETrsBfKHiJtIFQ785"); NSLog(@"6psmJaWVPS4FiwTEL"); NSLog(@"16s8M0CGOzwQhLIYRvKVTkqrEoWcJulN3tSB5P"); } -(void)aXwQpF9e:(UIMenuItem*) aXwQpF9e akNRlm1:(UIImageView*) akNRlm1 aBn9gm:(UIButton*) aBn9gm aThEm7rk:(UIButton*) aThEm7rk a6TQs:(UIEvent*) a6TQs aL32Tzusx:(UIImageView*) aL32Tzusx abM6A1CYsN:(UIScreen*) abM6A1CYsN ad7vsqZJ:(UIControlEvents*) ad7vsqZJ a5D02X4TO:(UIControl*) a5D02X4TO aGb8sor:(UIActivity*) aGb8sor aitTu5U2:(UIFontWeight*) aitTu5U2 a7F4DwQOV:(UIApplication*) a7F4DwQOV awpT0ir5UPl:(UIWindow*) awpT0ir5UPl atHeCR5:(UISearchBar*) atHeCR5 aMeAPaog:(UIAlertView*) aMeAPaog a5gSKD:(UIWindow*) a5gSKD { NSLog(@"Bd1pUGSb0jxEa6z9hCPW73KqOZnD"); NSLog(@"TP3finFuScBKZyrzxaXA4Cq2WQM8bI51L"); NSLog(@"0QHaey3bYXCfw4GBgkqdvlIU7joF5Or"); NSLog(@"hiuEHV1ZmB6GvkyoATsSpFt"); NSLog(@"dOTACxEo6Y1ihSqPMyGpNKJ8W0kInfcrj"); NSLog(@"U06EKPuF9Qtq5IxaJV8bmRpzcXH4s"); NSLog(@"DVpzdKEZGrsnbxSTo9BPw362qFeYkN"); NSLog(@"tvyTIbc5Mhe3WjudUpSaYFAfO6krNCKBHLZ"); NSLog(@"aGdcBPhLQAw6"); NSLog(@"HtOzXxQpJKoDNLiICcjSVYBb"); NSLog(@"35TVva6h7g0ANRfwyXdsGiMbQpKzUrW19JxHDquj"); NSLog(@"LStdCRKbuZQs9"); NSLog(@"CFBXp1xPlueTYyILMmanZOVrw0SgdUhzk36AK"); } -(void)ahJ6uZ3:(UIAlertView*) ahJ6uZ3 asri1VX:(UIBarButtonItem*) asri1VX aw37FDm:(UIInputView*) aw37FDm aj0W6u1:(UIImage*) aj0W6u1 aqI0aSwDMpf:(UIApplication*) aqI0aSwDMpf aYM8JRC7:(UIBarButtonItem*) aYM8JRC7 { NSLog(@"W1EmUDM0aqOHvsAk3"); NSLog(@"hGRb8M962m4BNLco5VqzwyTODEf7"); NSLog(@"m1ksv9cwy2JjP5zV83XIDq"); NSLog(@"V65B7jRa2OAqHQJKEYevnshI8rGbi0Sg"); NSLog(@"JOanAKEMU0LvHtXbF98Yoh"); NSLog(@"avC1SNp9rl"); NSLog(@"7R46fBg2KyuMonIrxSGaJbsimQUNHhwC"); NSLog(@"oylX95VNTntx"); NSLog(@"G5VSJCdjLwg2cO9E7ehz0ZX"); NSLog(@"9Orv5f7zatsSRkmgionFIplL6TMXyjWdb3h"); NSLog(@"skLJBnAFu9"); NSLog(@"ibpENqK3cHLMU"); NSLog(@"dBNQzL4RcpimbsZ1rMJ"); NSLog(@"hGmcBHKP170iRIXq6lTag5Qr4oJbApdCfZ2ExuOY"); } -(void)anTYP8h75K:(UISwitch*) anTYP8h75K aKbQP9:(UILabel*) aKbQP9 aKaNLc:(UIBarButtonItem*) aKaNLc aKfsZ2ow:(UIFontWeight*) aKfsZ2ow a8Ch4O35:(UIWindow*) a8Ch4O35 a6eR3b7E:(UIBarButtonItem*) a6eR3b7E aTS5kvBHf4x:(UIActivity*) aTS5kvBHf4x aZvLRMdmx3:(UIKeyCommand*) aZvLRMdmx3 ahrRdXx9:(UIInputView*) ahrRdXx9 { NSLog(@"SUrpHqLsMg"); NSLog(@"f1N50RVAJuIGkK3YrSyd"); NSLog(@"tyvGpjcnEWai8S9FL3XsU5KD0TYVMPdC"); NSLog(@"07blaRAh36QU9rLGIkxYEpZn"); NSLog(@"oEnf5JlDpmxc9012Mj4FPVsWrRCqGZaBOL8uzT"); NSLog(@"y4WrdTn2M6vsklUh3S5qJj1aiPcHpAGDwKIX9t"); NSLog(@"FXQ6VlSmCs7w9rNvi82EMk"); NSLog(@"lVfAgPFvJLyIUhKR"); NSLog(@"p1X8njrY4eHshu9i5yPvo07NgMx6bUfVc"); NSLog(@"5cuVoMfBnLrd4zbUP1gexZTjSK9DtRhJX7H0pvG"); NSLog(@"QrYd8JA5GtOcFTiPq"); NSLog(@"R0VXZpcwvkOy"); } @end