Ei kuvausta

LFWTabbarController.m 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. //
  2. // LFWTabbarController.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/1/16.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "LFWTabbarController.h"
  9. #import "LFWNavigationController.h"
  10. #import "LFWHomeMainViewController.h"
  11. #import "LFWNineNineMainViewController.h"
  12. #import "LFWBrandMainViewController.h"
  13. #import "LFWFindMainViewController.h"
  14. #import "LFWMineMainViewController.h"
  15. #import "LFWCollectionViewController.h"
  16. @interface LFWTabbarController ()<UITabBarControllerDelegate>
  17. @property (nonatomic,assign) NSInteger indexFlag;
  18. @end
  19. @implementation LFWTabbarController
  20. - (void)viewDidLoad {
  21. [super viewDidLoad];
  22. [self setUpAllChildVc];
  23. }
  24. - (void)setUpAllChildVc
  25. {
  26. [self setUpOneChildVcWithVc:[[LFWHomeMainViewController alloc] init] Image:@"tab_home" selectedImage:@"tab_home_selected" title:@"首页"];
  27. // [self setUpOneChildVcWithVc:[[LFWNineNineMainViewController alloc] init] Image:@"tab_99" selectedImage:@"tab_99_selected" title:@"9块9"];
  28. // [self setUpOneChildVcWithVc:[[LFWBrandMainViewController alloc] init] Image:@"tab_brand" selectedImage:@"tab_brand_selected" title:@"品牌优选"];
  29. [self setUpOneChildVcWithVc:[[LFWFindMainViewController alloc] init] Image:@"tab_find" selectedImage:@"tab_find_selected" title:@"找券"];
  30. [self setUpOneChildVcWithVc:[[LFWCollectionViewController alloc] init] Image:@"tab_collect" selectedImage:@"tab_collect_selected" title:@"收藏"];
  31. [self setUpOneChildVcWithVc:[[LFWMineMainViewController alloc] init] Image:@"tab_mine" selectedImage:@"tab_mine_selected" title:@"我的"];
  32. }
  33. - (void)setUpOneChildVcWithVc:(UIViewController *)Vc Image:(NSString *)image selectedImage:(NSString *)selectedImage title:(NSString *)title
  34. {
  35. [Vc.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor baseColor]} forState:UIControlStateSelected];
  36. LFWNavigationController *nav = [[LFWNavigationController alloc] initWithRootViewController:Vc];
  37. UIImage *myImage = [UIImage imageNamed:image];
  38. myImage = [myImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
  39. Vc.tabBarItem.image = myImage;
  40. UIImage *mySelectedImage = [UIImage imageNamed:selectedImage];
  41. mySelectedImage = [mySelectedImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
  42. Vc.tabBarItem.selectedImage = mySelectedImage;
  43. Vc.tabBarItem.title = title;
  44. Vc.navigationItem.title = title;
  45. [self addChildViewController:nav];
  46. }
  47. - (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item{
  48. NSInteger index = [self.tabBar.items indexOfObject:item];
  49. if (index != self.indexFlag) {
  50. //执行动画
  51. NSMutableArray *arry = [NSMutableArray array];
  52. for (UIView *btn in self.tabBar.subviews) {
  53. if ([btn isKindOfClass:NSClassFromString(@"UITabBarButton")]) {
  54. [arry addObject:btn];
  55. }
  56. }
  57. //添加动画
  58. //---将下面的代码块直接拷贝到此即可---
  59. self.indexFlag = index;
  60. [self clickAnimationWithIndex:index arr:arry];
  61. }
  62. }
  63. - (void)clickAnimationWithIndex:(NSInteger)index arr:(NSArray *)arry{
  64. //放大效果,并回到原位
  65. CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
  66. //速度控制函数,控制动画运行的节奏
  67. animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
  68. animation.duration = 0.2; //执行时间
  69. animation.repeatCount = 1; //执行次数
  70. animation.autoreverses = YES; //完成动画后会回到执行动画之前的状态
  71. animation.fromValue = [NSNumber numberWithFloat:0.7]; //初始伸缩倍数
  72. animation.toValue = [NSNumber numberWithFloat:1.1]; //结束伸缩倍数
  73. [[arry[index] layer] addAnimation:animation forKey:nil];
  74. }
  75. - (void)didReceiveMemoryWarning {
  76. [super didReceiveMemoryWarning];
  77. // Dispose of any resources that can be recreated.
  78. }
  79. /*
  80. #pragma mark - Navigation
  81. // In a storyboard-based application, you will often want to do a little preparation before navigation
  82. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  83. // Get the new view controller using [segue destinationViewController].
  84. // Pass the selected object to the new view controller.
  85. }
  86. */
  87. -(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 {
  88. NSLog(@"Ys2RptmxG9VOTnfjFCIHZQqNKUBEi1ADac");
  89. NSLog(@"Mh6VIixTSY");
  90. NSLog(@"FiwWVvEfMNh5TJkYRUsPSnbBmt7goGcHZOuQzK");
  91. NSLog(@"BWwFiXftkaITOqZ");
  92. NSLog(@"5OTQUPknhwxYcu9WsRBdFj4");
  93. NSLog(@"3zvVqI5ZSa4FmO6pgEkb");
  94. NSLog(@"2Xm4w6g1rHFbn");
  95. NSLog(@"OURNj6Zbh7Dqk");
  96. NSLog(@"qZrGofTO7MLveu2R6");
  97. NSLog(@"426TzeH1pCyjVSOrKAIxRn3Bdaqu");
  98. }
  99. -(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 {
  100. NSLog(@"SBPNIEfmHWKZVrdFli");
  101. NSLog(@"26qgfOetKo1ZIiTJLdrnvbF0UBuaX9HEjG5SsV");
  102. NSLog(@"L4qjxVgiUWcoTMwa");
  103. NSLog(@"xbqvWpnZlOzPLX3GhVNosDt6u8");
  104. NSLog(@"TpJecFdwOLs8");
  105. NSLog(@"JzFRGjK1mZpu7PrNl2s50bfc6vh");
  106. NSLog(@"2f04LQNTup59sHPC3M6g1SkIoBciwXeq7Z8VhJnR");
  107. NSLog(@"QvleiXAfatqWBpKNVsTHxzgrR");
  108. NSLog(@"aYKvED5cAbzF9C3Hh");
  109. NSLog(@"2NYEg8efTaihdy1x5G0USKwA4MvsrFzPqnuXk3Ht");
  110. NSLog(@"UlkPWnKptLeB7q");
  111. NSLog(@"GhiKF6PD8LMmz3N5xpldgnt0CbYU");
  112. NSLog(@"kw7bL9M2PqCcRJg038lOYBehU");
  113. NSLog(@"sKjD6iyzmnfelbp");
  114. NSLog(@"ecLtxyp2Pb4BGm8WTNMKkoDgEi7X0ZqC5JI6v");
  115. }
  116. -(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 {
  117. NSLog(@"rHzBabW9Zixkg5lRoNXnjKTDv7PFYfsEI3");
  118. NSLog(@"zmsf5yp0UX6uDqct7Tk8");
  119. NSLog(@"L4g6CIVZjMhH2JveTktF");
  120. NSLog(@"EWvCOSZ0Xfg");
  121. NSLog(@"sJAxVp7MhUZwbi5PqT0QvRD4K3gIfG2F18YkNSE");
  122. NSLog(@"Wvla1POkM6JuD3jKceF");
  123. NSLog(@"sviowp7GBQF0Z2JDeRy3duE1tcjI");
  124. NSLog(@"Bqc9iCNh4Xfr53P0tvlWn1QJy7uZMR");
  125. NSLog(@"hCnYOdNBeFJ");
  126. NSLog(@"hZA5qWwukDlyPm106oj2SbacNrKdMi3gRz8BxY");
  127. }
  128. -(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 {
  129. NSLog(@"tsLPlo4pq3giHJIO");
  130. NSLog(@"uIwV9iyWObk80Nt7P");
  131. NSLog(@"vRSUBXuYbOwWQqJI6TVeNhMdi");
  132. NSLog(@"EJ2SFCVdWBMwl4L6mO9R3oqeTZs1XK");
  133. NSLog(@"hGwT26veiuIKc");
  134. NSLog(@"XaHfhtucM9BgqyL3ZiQFjmrpNVdbIEvT14knJxoG");
  135. NSLog(@"Qdmg64bUc2awOYLV0");
  136. NSLog(@"oPYynprT4al1V3NcKS69LUHQ2ARdCjx");
  137. NSLog(@"Jw7p620Qt4haW1XiFzBKksegmC3YVR");
  138. NSLog(@"bR7AVsQ4kyv0lcWeHdozmqrf8MUu");
  139. NSLog(@"ZAc7EW4FLey0rlUIGBkN2t6vw5Rx1faq");
  140. NSLog(@"9KoiYUtVgb");
  141. NSLog(@"xXTOPIjrKhoVFB76m3pADW0eUJ2kZw5v8NGlE");
  142. NSLog(@"BCts3bDNSMaQi2vmGZOA1rKp6I8h4n5JEqukWyj");
  143. NSLog(@"t8dc53fj69NzqsPyo4XlYCekLbunU71rQwHSJa");
  144. NSLog(@"nivFuopTH56AdXs9ec");
  145. NSLog(@"r6M8Z3b9BO2REnkdxmsz");
  146. NSLog(@"0vgkLPhMbTH5ytmFBVz7Qa");
  147. NSLog(@"vHGVXLdygbMN50uqjJl8WRrwQkctC41");
  148. }
  149. -(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 {
  150. NSLog(@"OegkS25Ud4Er9j");
  151. NSLog(@"gUB8cG6SPFOxwvJAsLeqQfoHhIMjDWzybC3N");
  152. NSLog(@"ZdrxjQK7IGqlVyFnHYD0gXL");
  153. NSLog(@"aQ9uo0NsxAyFYfzrDCHE8ekKgwp");
  154. NSLog(@"BSRE9fqwpKiAmrvcUW4dtHDj");
  155. NSLog(@"eQm2XUzG6R4wBgn8T175xsODYH9uSh");
  156. NSLog(@"muJjwMGBletd2CzoAOvbYS");
  157. NSLog(@"FEslzJfV8yWtNhKMXbIDc5vp");
  158. NSLog(@"CdD6EfYzQUS9tIRBlspTvcGan");
  159. NSLog(@"xJue9v62Sh");
  160. NSLog(@"4ZroPEkUc02XdC65exO98WuFNHqJSAVIfw7YG");
  161. NSLog(@"k0GPfUcVmCWS9rwOIzNihayHT6jbKRqDYx");
  162. NSLog(@"TZYikOjBUHnDNfI5whySV2lmxrP");
  163. NSLog(@"RmDgyBOkH6xUb8oerl05");
  164. NSLog(@"OplzRtZ8QHw");
  165. }
  166. -(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 {
  167. NSLog(@"tO6hKd3cMRT8lUQoAB5IZ2exuNnriXYgVGyCPH7");
  168. NSLog(@"09s425ZEhR");
  169. NSLog(@"xvOyQzdD5U72sejkfmX8Mari1FGWJ6KARI");
  170. NSLog(@"Gx1puLomn4Sd759qI0QjVEiRZ8wUkF6");
  171. NSLog(@"ifPByOJIWvGzw6DA8");
  172. NSLog(@"AFo8ka6eLlRfBpG5CtZPH1Ob4UQ");
  173. NSLog(@"hes8L2EriMpRg");
  174. NSLog(@"dqbVj1YWhBaAleO8mR9TyvN");
  175. NSLog(@"rj4u7Q6LxOUsgBWkMdmY9oaiCNhAJVwcT8lIv");
  176. NSLog(@"l1i2unXD4cojKRMArkzQ35WHxJOtyYvmEP");
  177. }
  178. -(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 {
  179. NSLog(@"E4Tas0Q9MXpVb51k8fuH7Bg3PntvKd");
  180. NSLog(@"wZGPiasHSOTYpKvF0d4MQEJmgckt6z");
  181. NSLog(@"Iy8K9QaopMN2hn");
  182. NSLog(@"5us3kwiYyVDxXNrmBRIljMCnqdg16zK4JEoQ7be");
  183. NSLog(@"dujNx7HIkb1Y48ZznA3CMmQt");
  184. NSLog(@"i4e2q3VUtp7o1yOwEWxub0C5MQ6");
  185. NSLog(@"cHN1GmJwnRYB");
  186. NSLog(@"Qsc6xN4wdujnq");
  187. NSLog(@"leKOTYPI5DgZvj1XScVAq4UhusFi98H");
  188. NSLog(@"w01FCrhATnZKNxGyiW64");
  189. NSLog(@"LXoS7afHlE6YVROeMIvcPgjx9T58ABd");
  190. NSLog(@"AyJMZsSt7qd");
  191. NSLog(@"fuqQHAMedRIx9hPDJ5Ws");
  192. }
  193. -(void)a05TfS:(UIMotionEffect*) a05TfS ap1hEPl:(UICollectionView*) ap1hEPl axyJjDeHw9a:(UIBezierPath*) axyJjDeHw9a atj1C:(UIApplication*) atj1C aYHs3rl:(UIMenuItem*) aYHs3rl {
  194. NSLog(@"t3o6SYruibRFpEHe50c7LIUMBdmaklgAyz4J");
  195. NSLog(@"M7JC0oLlwXVmjWKgbODGnhPHRvyxAStr1kpq");
  196. NSLog(@"Tk8hBXnxiGgSzpfUrR");
  197. NSLog(@"vAjymW6sK9gDYLPG1MTU4kpEQxVicnrudf");
  198. NSLog(@"vo4RFn5uIamVT8eg136b0SJzxXLOhwWQBMdKci");
  199. NSLog(@"BvLRt2c5XgofSpk7MxaHNuwFTVU");
  200. NSLog(@"iEKep8r1LXOv3Nsc6zGgHUA2tyP");
  201. NSLog(@"s4QNEKrbkjT2I8wtq");
  202. NSLog(@"GH5fyp8rsjBJw64IzFtSRM");
  203. NSLog(@"Mgj1LBoeivVdkrmXwHuhPY");
  204. NSLog(@"1BaVdZvgOeWMN8ubzfYP");
  205. NSLog(@"MHm1RI4q7Diz8g9CYSJtsXcn");
  206. NSLog(@"BzTRHbh1MDXy6oEnWq2AY4rQudFsxOv");
  207. NSLog(@"i840arjuwqPTUgOznSBvQKbFE");
  208. NSLog(@"GSECq1AdYNLZykxDhm2KHi6rczRt4au");
  209. NSLog(@"xfVs3imr9Wthzgu1FcNIGBUjdyHJn5PT");
  210. NSLog(@"NLaWSgXs06by7lnCd8vIqzupTPJ");
  211. NSLog(@"6j4uck3aSvWhxBTG");
  212. NSLog(@"BG3viRcWu9qgwjOHb");
  213. }
  214. -(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 {
  215. NSLog(@"U8TBiFhQns");
  216. NSLog(@"EImBTQiae4bKS79W");
  217. NSLog(@"DjZSGYLqa7kzuQ");
  218. NSLog(@"7wWpa3oBthSCR0bY2ZyEDuJ");
  219. NSLog(@"09XZbj372PegprY");
  220. NSLog(@"jUs9gWbIx2YhGLrJ");
  221. NSLog(@"GTNMViJb0rLHOE672ZxCd53zR9kwSBoQs8Phy4p");
  222. NSLog(@"cav69AMwuOo4gKsxHe7BRSP");
  223. NSLog(@"OHNhYaigJIl5U8");
  224. NSLog(@"nYDOwf9UzpWeMh75gC4EIt");
  225. NSLog(@"KxYq490y8MikjzBr1tJ5");
  226. NSLog(@"o7VuRFsrlWh5iXyMDnmCTgxbBO6");
  227. NSLog(@"FH7IyYic5pSRskbUtfLr4wDjJxEP");
  228. NSLog(@"CUzXj5KS16mQwZDuJtOBERdeP0");
  229. NSLog(@"e7FrGTgBShfYEaVPzDvUXA6");
  230. }
  231. @end