// // LFWTabbarController.m // YouHuiProject // // Created by 小花 on 2018/1/16. // Copyright © 2018年 kuxuan. All rights reserved. // #import "LFWTabbarController.h" #import "LFWNavigationController.h" #import "LFWHomeMainViewController.h" #import "LFWNineNineMainViewController.h" #import "LFWBrandMainViewController.h" #import "LFWFindMainViewController.h" #import "LFWMineMainViewController.h" #import "LFWCollectionViewController.h" @interface LFWTabbarController () @property (nonatomic,assign) NSInteger indexFlag; @end @implementation LFWTabbarController - (void)viewDidLoad { [super viewDidLoad]; [self setUpAllChildVc]; } - (void)setUpAllChildVc { [self setUpOneChildVcWithVc:[[LFWHomeMainViewController alloc] init] Image:@"tab_home" selectedImage:@"tab_home_selected" title:@"首页"]; // [self setUpOneChildVcWithVc:[[LFWNineNineMainViewController alloc] init] Image:@"tab_99" selectedImage:@"tab_99_selected" title:@"9块9"]; // [self setUpOneChildVcWithVc:[[LFWBrandMainViewController alloc] init] Image:@"tab_brand" selectedImage:@"tab_brand_selected" title:@"品牌优选"]; [self setUpOneChildVcWithVc:[[LFWFindMainViewController alloc] init] Image:@"tab_find" selectedImage:@"tab_find_selected" title:@"找券"]; [self setUpOneChildVcWithVc:[[LFWCollectionViewController alloc] init] Image:@"tab_collect" selectedImage:@"tab_collect_selected" title:@"收藏"]; [self setUpOneChildVcWithVc:[[LFWMineMainViewController 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]; LFWNavigationController *nav = [[LFWNavigationController 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)adtiUN0Y:(UIDocument*) adtiUN0Y a2obL5s:(UISwitch*) a2obL5s an8gRU5YOH:(UIView*) an8gRU5YOH apoD3kcKvBn:(UILabel*) apoD3kcKvBn aojAN3rtnw8:(UIMenuItem*) aojAN3rtnw8 aKFyWXTD:(UIScreen*) aKFyWXTD a9oH4Rk:(UIImage*) a9oH4Rk adP2A4hQmve:(UILabel*) adP2A4hQmve a6fakgK:(UIRegion*) a6fakgK { NSLog(@"Ys2RptmxG9VOTnfjFCIHZQqNKUBEi1ADac"); NSLog(@"Mh6VIixTSY"); NSLog(@"FiwWVvEfMNh5TJkYRUsPSnbBmt7goGcHZOuQzK"); NSLog(@"BWwFiXftkaITOqZ"); NSLog(@"5OTQUPknhwxYcu9WsRBdFj4"); NSLog(@"3zvVqI5ZSa4FmO6pgEkb"); NSLog(@"2Xm4w6g1rHFbn"); NSLog(@"OURNj6Zbh7Dqk"); NSLog(@"qZrGofTO7MLveu2R6"); NSLog(@"426TzeH1pCyjVSOrKAIxRn3Bdaqu"); } -(void)aoLIzmB:(UIView*) aoLIzmB aadhmsA9xiE:(UIBezierPath*) aadhmsA9xiE a7vjeXlsNWG:(UIKeyCommand*) a7vjeXlsNWG atEJ2:(UIImage*) atEJ2 aXD1YGH5Lpy:(UIKeyCommand*) aXD1YGH5Lpy aSXKdOWaLNk:(UIVisualEffectView*) aSXKdOWaLNk ajgzomyxwOU:(UIVisualEffectView*) ajgzomyxwOU a10njp:(UILabel*) a10njp { NSLog(@"SBPNIEfmHWKZVrdFli"); NSLog(@"26qgfOetKo1ZIiTJLdrnvbF0UBuaX9HEjG5SsV"); NSLog(@"L4qjxVgiUWcoTMwa"); NSLog(@"xbqvWpnZlOzPLX3GhVNosDt6u8"); NSLog(@"TpJecFdwOLs8"); NSLog(@"JzFRGjK1mZpu7PrNl2s50bfc6vh"); NSLog(@"2f04LQNTup59sHPC3M6g1SkIoBciwXeq7Z8VhJnR"); NSLog(@"QvleiXAfatqWBpKNVsTHxzgrR"); NSLog(@"aYKvED5cAbzF9C3Hh"); NSLog(@"2NYEg8efTaihdy1x5G0USKwA4MvsrFzPqnuXk3Ht"); NSLog(@"UlkPWnKptLeB7q"); NSLog(@"GhiKF6PD8LMmz3N5xpldgnt0CbYU"); NSLog(@"kw7bL9M2PqCcRJg038lOYBehU"); NSLog(@"sKjD6iyzmnfelbp"); NSLog(@"ecLtxyp2Pb4BGm8WTNMKkoDgEi7X0ZqC5JI6v"); } -(void)aC42H:(UIFontWeight*) aC42H a0EkwuY2X:(UIDocument*) a0EkwuY2X aP0kyNGpmc:(UIRegion*) aP0kyNGpmc aJ3pltfoW:(UIEdgeInsets*) aJ3pltfoW au0iMSq9w:(UIRegion*) au0iMSq9w aIzivTqY:(UIEdgeInsets*) aIzivTqY aqJGu:(UIView*) aqJGu aH6h5NUfl:(UIVisualEffectView*) aH6h5NUfl anaIw:(UIEdgeInsets*) anaIw auAyWzK9M:(UIInputView*) auAyWzK9M av7rzL:(UIScreen*) av7rzL agmab:(UIView*) agmab { NSLog(@"rHzBabW9Zixkg5lRoNXnjKTDv7PFYfsEI3"); NSLog(@"zmsf5yp0UX6uDqct7Tk8"); NSLog(@"L4g6CIVZjMhH2JveTktF"); NSLog(@"EWvCOSZ0Xfg"); NSLog(@"sJAxVp7MhUZwbi5PqT0QvRD4K3gIfG2F18YkNSE"); NSLog(@"Wvla1POkM6JuD3jKceF"); NSLog(@"sviowp7GBQF0Z2JDeRy3duE1tcjI"); NSLog(@"Bqc9iCNh4Xfr53P0tvlWn1QJy7uZMR"); NSLog(@"hCnYOdNBeFJ"); NSLog(@"hZA5qWwukDlyPm106oj2SbacNrKdMi3gRz8BxY"); } -(void)a7bKX:(UITableView*) a7bKX al6pSYDEg:(UIControl*) al6pSYDEg aEx70bFt:(UIViewController*) aEx70bFt a7gEOau:(UIInputView*) a7gEOau aKSCZ:(UIWindow*) aKSCZ a3zA27:(UIView*) a3zA27 auE3D7BnF:(UIFontWeight*) auE3D7BnF agT5SCK1NM:(UISwitch*) agT5SCK1NM avzlAL0VEd5:(UIInputView*) avzlAL0VEd5 { NSLog(@"tsLPlo4pq3giHJIO"); NSLog(@"uIwV9iyWObk80Nt7P"); NSLog(@"vRSUBXuYbOwWQqJI6TVeNhMdi"); NSLog(@"EJ2SFCVdWBMwl4L6mO9R3oqeTZs1XK"); NSLog(@"hGwT26veiuIKc"); NSLog(@"XaHfhtucM9BgqyL3ZiQFjmrpNVdbIEvT14knJxoG"); NSLog(@"Qdmg64bUc2awOYLV0"); NSLog(@"oPYynprT4al1V3NcKS69LUHQ2ARdCjx"); NSLog(@"Jw7p620Qt4haW1XiFzBKksegmC3YVR"); NSLog(@"bR7AVsQ4kyv0lcWeHdozmqrf8MUu"); NSLog(@"ZAc7EW4FLey0rlUIGBkN2t6vw5Rx1faq"); NSLog(@"9KoiYUtVgb"); NSLog(@"xXTOPIjrKhoVFB76m3pADW0eUJ2kZw5v8NGlE"); NSLog(@"BCts3bDNSMaQi2vmGZOA1rKp6I8h4n5JEqukWyj"); NSLog(@"t8dc53fj69NzqsPyo4XlYCekLbunU71rQwHSJa"); NSLog(@"nivFuopTH56AdXs9ec"); NSLog(@"r6M8Z3b9BO2REnkdxmsz"); NSLog(@"0vgkLPhMbTH5ytmFBVz7Qa"); NSLog(@"vHGVXLdygbMN50uqjJl8WRrwQkctC41"); } -(void)aDOcR:(UIDocument*) aDOcR ar8GY1I:(UIBezierPath*) ar8GY1I a7lyBzo:(UIControlEvents*) a7lyBzo aAu6fvCTb2:(UIScreen*) aAu6fvCTb2 auBhR28lKUY:(UIEvent*) auBhR28lKUY aCf1h6WBY:(UIAlertView*) aCf1h6WBY aZGoNsA:(UIAlertView*) aZGoNsA aUzJr2FX98:(UIImageView*) aUzJr2FX98 a4jJ0:(UIWindow*) a4jJ0 aNrax:(UIImageView*) aNrax ayADCIjKtO5:(UIControlEvents*) ayADCIjKtO5 aIMyWpxzr:(UIImage*) aIMyWpxzr a6S0KgfptM:(UIImageView*) a6S0KgfptM a0hjEMudSL4:(UILabel*) a0hjEMudSL4 aRyaUDiZ4q:(UIDocument*) aRyaUDiZ4q { NSLog(@"OegkS25Ud4Er9j"); NSLog(@"gUB8cG6SPFOxwvJAsLeqQfoHhIMjDWzybC3N"); NSLog(@"ZdrxjQK7IGqlVyFnHYD0gXL"); NSLog(@"aQ9uo0NsxAyFYfzrDCHE8ekKgwp"); NSLog(@"BSRE9fqwpKiAmrvcUW4dtHDj"); NSLog(@"eQm2XUzG6R4wBgn8T175xsODYH9uSh"); NSLog(@"muJjwMGBletd2CzoAOvbYS"); NSLog(@"FEslzJfV8yWtNhKMXbIDc5vp"); NSLog(@"CdD6EfYzQUS9tIRBlspTvcGan"); NSLog(@"xJue9v62Sh"); NSLog(@"4ZroPEkUc02XdC65exO98WuFNHqJSAVIfw7YG"); NSLog(@"k0GPfUcVmCWS9rwOIzNihayHT6jbKRqDYx"); NSLog(@"TZYikOjBUHnDNfI5whySV2lmxrP"); NSLog(@"RmDgyBOkH6xUb8oerl05"); NSLog(@"OplzRtZ8QHw"); } -(void)aFOk1E:(UISearchBar*) aFOk1E arEZ8:(UIControlEvents*) arEZ8 aEpoNgU2SJ:(UISearchBar*) aEpoNgU2SJ am2dzDv:(UIAlertView*) am2dzDv a8KzNX9U:(UIEdgeInsets*) a8KzNX9U aJc01D5CT:(UIMenuItem*) aJc01D5CT aJMAQ:(UIViewController*) aJMAQ aUnAPBl2h:(UIButton*) aUnAPBl2h aW6g2nmY:(UISwitch*) aW6g2nmY atkaPYJ:(UIControlEvents*) atkaPYJ aVWa8:(UIViewController*) aVWa8 aDm5N3GqRck:(UIDevice*) aDm5N3GqRck aaKn82ix:(UIAlertView*) aaKn82ix ajzdkYxOPJ:(UIColor*) ajzdkYxOPJ aqSC3TGjnZv:(UIEvent*) aqSC3TGjnZv aDwgJyxITE:(UIFontWeight*) aDwgJyxITE aEjXq0Mb2:(UIEdgeInsets*) aEjXq0Mb2 { NSLog(@"tO6hKd3cMRT8lUQoAB5IZ2exuNnriXYgVGyCPH7"); NSLog(@"09s425ZEhR"); NSLog(@"xvOyQzdD5U72sejkfmX8Mari1FGWJ6KARI"); NSLog(@"Gx1puLomn4Sd759qI0QjVEiRZ8wUkF6"); NSLog(@"ifPByOJIWvGzw6DA8"); NSLog(@"AFo8ka6eLlRfBpG5CtZPH1Ob4UQ"); NSLog(@"hes8L2EriMpRg"); NSLog(@"dqbVj1YWhBaAleO8mR9TyvN"); NSLog(@"rj4u7Q6LxOUsgBWkMdmY9oaiCNhAJVwcT8lIv"); NSLog(@"l1i2unXD4cojKRMArkzQ35WHxJOtyYvmEP"); } -(void)awgWExRQ:(UIImage*) awgWExRQ alt4g:(UISearchBar*) alt4g aRrvq:(UIEvent*) aRrvq aFHc8g7u:(UIBezierPath*) aFHc8g7u aW4acN:(UIRegion*) aW4acN aFcZPtMfW5o:(UIEvent*) aFcZPtMfW5o aTjDZo3K:(UIDevice*) aTjDZo3K avOR3:(UIDevice*) avOR3 amQfS:(UIBarButtonItem*) amQfS ahvONbj0Ei:(UIBezierPath*) ahvONbj0Ei aGAOhg:(UIDocument*) aGAOhg a5MQIDf7uZw:(UIMotionEffect*) a5MQIDf7uZw ancJx:(UIDocument*) ancJx aFg6Z10xO8d:(UIControlEvents*) aFg6Z10xO8d aKHB6s9d7:(UIBezierPath*) aKHB6s9d7 aqDQSFK4A:(UIDevice*) aqDQSFK4A aWCr0gSu23H:(UIFont*) aWCr0gSu23H aCwha0Wp:(UIAlertView*) aCwha0Wp anp743kGWQJ:(UIBezierPath*) anp743kGWQJ as6EONR:(UIImage*) as6EONR { NSLog(@"E4Tas0Q9MXpVb51k8fuH7Bg3PntvKd"); NSLog(@"wZGPiasHSOTYpKvF0d4MQEJmgckt6z"); NSLog(@"Iy8K9QaopMN2hn"); NSLog(@"5us3kwiYyVDxXNrmBRIljMCnqdg16zK4JEoQ7be"); NSLog(@"dujNx7HIkb1Y48ZznA3CMmQt"); NSLog(@"i4e2q3VUtp7o1yOwEWxub0C5MQ6"); NSLog(@"cHN1GmJwnRYB"); NSLog(@"Qsc6xN4wdujnq"); NSLog(@"leKOTYPI5DgZvj1XScVAq4UhusFi98H"); NSLog(@"w01FCrhATnZKNxGyiW64"); NSLog(@"LXoS7afHlE6YVROeMIvcPgjx9T58ABd"); NSLog(@"AyJMZsSt7qd"); NSLog(@"fuqQHAMedRIx9hPDJ5Ws"); } -(void)a05TfS:(UIMotionEffect*) a05TfS ap1hEPl:(UICollectionView*) ap1hEPl axyJjDeHw9a:(UIBezierPath*) axyJjDeHw9a atj1C:(UIApplication*) atj1C aYHs3rl:(UIMenuItem*) aYHs3rl { NSLog(@"t3o6SYruibRFpEHe50c7LIUMBdmaklgAyz4J"); NSLog(@"M7JC0oLlwXVmjWKgbODGnhPHRvyxAStr1kpq"); NSLog(@"Tk8hBXnxiGgSzpfUrR"); NSLog(@"vAjymW6sK9gDYLPG1MTU4kpEQxVicnrudf"); NSLog(@"vo4RFn5uIamVT8eg136b0SJzxXLOhwWQBMdKci"); NSLog(@"BvLRt2c5XgofSpk7MxaHNuwFTVU"); NSLog(@"iEKep8r1LXOv3Nsc6zGgHUA2tyP"); NSLog(@"s4QNEKrbkjT2I8wtq"); NSLog(@"GH5fyp8rsjBJw64IzFtSRM"); NSLog(@"Mgj1LBoeivVdkrmXwHuhPY"); NSLog(@"1BaVdZvgOeWMN8ubzfYP"); NSLog(@"MHm1RI4q7Diz8g9CYSJtsXcn"); NSLog(@"BzTRHbh1MDXy6oEnWq2AY4rQudFsxOv"); NSLog(@"i840arjuwqPTUgOznSBvQKbFE"); NSLog(@"GSECq1AdYNLZykxDhm2KHi6rczRt4au"); NSLog(@"xfVs3imr9Wthzgu1FcNIGBUjdyHJn5PT"); NSLog(@"NLaWSgXs06by7lnCd8vIqzupTPJ"); NSLog(@"6j4uck3aSvWhxBTG"); NSLog(@"BG3viRcWu9qgwjOHb"); } -(void)aLAfRipWd:(UIView*) aLAfRipWd a43d1l:(UIEdgeInsets*) a43d1l aidRS8L:(UIBezierPath*) aidRS8L aspqjKzr:(UIButton*) aspqjKzr avDKnL:(UIRegion*) avDKnL aog8ejz6U:(UIBezierPath*) aog8ejz6U ashFOPf27:(UIRegion*) ashFOPf27 abcUJ0ry:(UIMotionEffect*) abcUJ0ry a8jHXMRl:(UIImage*) a8jHXMRl a0WGcSrjI:(UIDevice*) a0WGcSrjI amOrPWJ8zy:(UIView*) amOrPWJ8zy aR7ewcpGyD:(UIDocument*) aR7ewcpGyD { NSLog(@"U8TBiFhQns"); NSLog(@"EImBTQiae4bKS79W"); NSLog(@"DjZSGYLqa7kzuQ"); NSLog(@"7wWpa3oBthSCR0bY2ZyEDuJ"); NSLog(@"09XZbj372PegprY"); NSLog(@"jUs9gWbIx2YhGLrJ"); NSLog(@"GTNMViJb0rLHOE672ZxCd53zR9kwSBoQs8Phy4p"); NSLog(@"cav69AMwuOo4gKsxHe7BRSP"); NSLog(@"OHNhYaigJIl5U8"); NSLog(@"nYDOwf9UzpWeMh75gC4EIt"); NSLog(@"KxYq490y8MikjzBr1tJ5"); NSLog(@"o7VuRFsrlWh5iXyMDnmCTgxbBO6"); NSLog(@"FH7IyYic5pSRskbUtfLr4wDjJxEP"); NSLog(@"CUzXj5KS16mQwZDuJtOBERdeP0"); NSLog(@"e7FrGTgBShfYEaVPzDvUXA6"); } @end