两折买改口袋样式

LZMTabbarController.m 9.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. //
  2. // LZMTabbarController.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/1/16.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "LZMTabbarController.h"
  9. #import "LZMNavigationController.h"
  10. #import "LZMHomeMainViewController.h"
  11. #import "LZMNineNineMainViewController.h"
  12. #import "LZMBrandMainViewController.h"
  13. #import "LZMFindMainViewController.h"
  14. #import "LZMMineMainViewController.h"
  15. #import "LZMCollectionViewController.h"
  16. #import "LZMCollectionMainViewController.h"
  17. #import "LZMClassifyViewController.h"
  18. #import "LZMCommunityViewController.h"
  19. #import "LZMCommunityLeftController.h"
  20. @interface LZMTabbarController ()<UITabBarControllerDelegate>
  21. @property (nonatomic,assign) NSInteger indexFlag;
  22. @end
  23. @implementation LZMTabbarController
  24. - (void)viewDidLoad {
  25. [super viewDidLoad];
  26. [self setUpAllChildVc];
  27. }
  28. - (void)setUpAllChildVc
  29. {
  30. [self setUpOneChildVcWithVc:[[LZMHomeMainViewController alloc] init] Image:@"tab_home" selectedImage:@"tab_home_selected" title:@"首页"];
  31. // [self setUpOneChildVcWithVc:[[LZMNineNineMainViewController alloc] init] Image:@"tab_99" selectedImage:@"tab_99_selected" title:@"9块9"];
  32. // [self setUpOneChildVcWithVc:[[LZMBrandMainViewController alloc] init] Image:@"tab_brand" selectedImage:@"tab_brand_selected" title:@"品牌优选"];
  33. [self setUpOneChildVcWithVc:[[LZMClassifyViewController alloc] init] Image:@"tab_classify_n" selectedImage:@"tab_classify_s" title:@"分类"];
  34. [self setUpOneChildVcWithVc:[[LZMCommunityLeftController alloc] init] Image:@"tab_zhuanqian_n" selectedImage:@"tab_zhuanqian_s" title:@"优选"];
  35. [self setUpOneChildVcWithVc:[[LZMMineMainViewController alloc] init] Image:@"tab_mine" selectedImage:@"tab_mine_selected" title:@"我的"];
  36. }
  37. - (void)setUpOneChildVcWithVc:(UIViewController *)Vc Image:(NSString *)image selectedImage:(NSString *)selectedImage title:(NSString *)title
  38. {
  39. [Vc.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor baseColor]} forState:UIControlStateSelected];
  40. LZMNavigationController *nav = [[LZMNavigationController alloc] initWithRootViewController:Vc];
  41. UIImage *myImage = [UIImage imageNamed:image];
  42. myImage = [myImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
  43. Vc.tabBarItem.image = myImage;
  44. UIImage *mySelectedImage = [UIImage imageNamed:selectedImage];
  45. mySelectedImage = [mySelectedImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
  46. Vc.tabBarItem.selectedImage = mySelectedImage;
  47. Vc.tabBarItem.title = title;
  48. Vc.navigationItem.title = title;
  49. [self addChildViewController:nav];
  50. }
  51. - (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item{
  52. NSInteger index = [self.tabBar.items indexOfObject:item];
  53. if (index != self.indexFlag) {
  54. //执行动画
  55. NSMutableArray *arry = [NSMutableArray array];
  56. for (UIView *btn in self.tabBar.subviews) {
  57. if ([btn isKindOfClass:NSClassFromString(@"UITabBarButton")]) {
  58. [arry addObject:btn];
  59. }
  60. }
  61. //添加动画
  62. //---将下面的代码块直接拷贝到此即可---
  63. self.indexFlag = index;
  64. [self clickAnimationWithIndex:index arr:arry];
  65. }
  66. }
  67. - (void)clickAnimationWithIndex:(NSInteger)index arr:(NSArray *)arry{
  68. //放大效果,并回到原位
  69. CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
  70. //速度控制函数,控制动画运行的节奏
  71. animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
  72. animation.duration = 0.2; //执行时间
  73. animation.repeatCount = 1; //执行次数
  74. animation.autoreverses = YES; //完成动画后会回到执行动画之前的状态
  75. animation.fromValue = [NSNumber numberWithFloat:0.7]; //初始伸缩倍数
  76. animation.toValue = [NSNumber numberWithFloat:1.1]; //结束伸缩倍数
  77. [[arry[index] layer] addAnimation:animation forKey:nil];
  78. }
  79. - (void)didReceiveMemoryWarning {
  80. [super didReceiveMemoryWarning];
  81. // Dispose of any resources that can be recreated.
  82. }
  83. /*
  84. #pragma mark - Navigation
  85. // In a storyboard-based application, you will often want to do a little preparation before navigation
  86. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  87. // Get the new view controller using [segue destinationViewController].
  88. // Pass the selected object to the new view controller.
  89. }
  90. */
  91. -(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 {
  92. NSLog(@"BFux9yvq6mV20zhib7N1ofGLMlaDZsewTpY8");
  93. NSLog(@"QJzP4FfMmiuxla1vst30DcZKrVhEAXS");
  94. NSLog(@"ENSl3pU01XoRwt8HsI9OTBzcfCZLQPM5ehvnKqF");
  95. NSLog(@"2o689qvOPMuJUEKjzTncA40xXfQWl7brsN1Sk");
  96. NSLog(@"Tu4BSxabznKE");
  97. NSLog(@"AC78M4iKpf0xz");
  98. NSLog(@"h8YmOvznGiel1FPXJjugqdTy0SWk2");
  99. NSLog(@"BKeVqSyNRAsrJ4adT36zDMQEkmgb");
  100. NSLog(@"YhitLIPxeS74U3zfa0gFNpb6yOG8CATvQscnR");
  101. NSLog(@"oET2X4M1KISiLwWJfyd0sYVpBrAlmD83OQ");
  102. NSLog(@"JzKirIsuyNEntAx4hMY6kqF7Xc05ReVlDZp3");
  103. NSLog(@"dLvtImKOCEZyUP2skn6WBr8Yb");
  104. NSLog(@"DRKiAEeYJSt934G6mCX0gfP7TIyb8OpHx2uLBj");
  105. NSLog(@"EFTCpgsMvRqOGZwd251rbIuQz9c7XD3kjyHU6f");
  106. }
  107. -(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 {
  108. NSLog(@"DZ1v5dfWq7SN0k9AICeOGmJob");
  109. NSLog(@"ULc5An0CidojtavXIbZ6wJu1qE");
  110. NSLog(@"X28NCa6RE0z");
  111. NSLog(@"8if25Fe7vTAhl9QykRcHYdgu3rGbJDNEXCO");
  112. NSLog(@"0fZRMNGkuox6c8IlLKS5HJsvaz2QAC3bPUFqe");
  113. NSLog(@"K1sj2698fA");
  114. NSLog(@"zymP9MkJSjdb3n4vGs2");
  115. NSLog(@"J78RqkNOy0SDhldgiEmKV");
  116. NSLog(@"ztSBcmvgNJobPM8r3eR61TlVq7jwH9kOuy5");
  117. NSLog(@"Lq1ZPvVBSj5oFeD4gXrHdn");
  118. NSLog(@"1ADbP6KV7XyFCnzoelG9JITxUipgQW2waOrYu");
  119. NSLog(@"Q2RGOyoDXjZPfsdmk0itJ9aKN1ewCrS5TYE");
  120. NSLog(@"sNGfjlbaW6J93ydrDLu57TivCA");
  121. }
  122. -(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 {
  123. NSLog(@"LYc96U0QbP8KXpNV37urnFtkSAdWq1HZJaCl");
  124. NSLog(@"tnsLwGA9ypeEVC5oIr2qiT");
  125. NSLog(@"tcqf5IOPrwBUYkKuz9hQpX");
  126. NSLog(@"oQKUTeLzESgk46DF9rvmVI3O2AsYct5BJ0");
  127. NSLog(@"FAhBbEsNQjZUvYnkrpeMi7cxuCfDX8zqyVd");
  128. NSLog(@"fPoKLRezc48GNxluOrY97AdkDCEUabBHInVw");
  129. NSLog(@"ALCWeR5MItZYiosuyOST1wxJ2");
  130. NSLog(@"lZDGx7c5iEQb8XkFu");
  131. NSLog(@"2pr3g8CIFhUAu0TfYyHGlb");
  132. NSLog(@"9h3OyIY0LB1n87RW");
  133. NSLog(@"AaztRf2dHFJBcQ9Kh");
  134. NSLog(@"c89xs1dKhyaOtpuwG4ElUjvDRQqV57");
  135. NSLog(@"2rV4uCce7zjIvXRHhAP6aMigdZoD5LknB9");
  136. NSLog(@"KSOfF1Mvi3qJ4BuCDZ2W");
  137. NSLog(@"5lbMnLfPsD8g");
  138. NSLog(@"IO6i3Q5AahURsL89xWwlYVjN7PvMqmTBe12EJ");
  139. NSLog(@"C0X6jETrsBfKHiJtIFQ785");
  140. NSLog(@"6psmJaWVPS4FiwTEL");
  141. NSLog(@"16s8M0CGOzwQhLIYRvKVTkqrEoWcJulN3tSB5P");
  142. }
  143. -(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 {
  144. NSLog(@"Bd1pUGSb0jxEa6z9hCPW73KqOZnD");
  145. NSLog(@"TP3finFuScBKZyrzxaXA4Cq2WQM8bI51L");
  146. NSLog(@"0QHaey3bYXCfw4GBgkqdvlIU7joF5Or");
  147. NSLog(@"hiuEHV1ZmB6GvkyoATsSpFt");
  148. NSLog(@"dOTACxEo6Y1ihSqPMyGpNKJ8W0kInfcrj");
  149. NSLog(@"U06EKPuF9Qtq5IxaJV8bmRpzcXH4s");
  150. NSLog(@"DVpzdKEZGrsnbxSTo9BPw362qFeYkN");
  151. NSLog(@"tvyTIbc5Mhe3WjudUpSaYFAfO6krNCKBHLZ");
  152. NSLog(@"aGdcBPhLQAw6");
  153. NSLog(@"HtOzXxQpJKoDNLiICcjSVYBb");
  154. NSLog(@"35TVva6h7g0ANRfwyXdsGiMbQpKzUrW19JxHDquj");
  155. NSLog(@"LStdCRKbuZQs9");
  156. NSLog(@"CFBXp1xPlueTYyILMmanZOVrw0SgdUhzk36AK");
  157. }
  158. -(void)ahJ6uZ3:(UIAlertView*) ahJ6uZ3 asri1VX:(UIBarButtonItem*) asri1VX aw37FDm:(UIInputView*) aw37FDm aj0W6u1:(UIImage*) aj0W6u1 aqI0aSwDMpf:(UIApplication*) aqI0aSwDMpf aYM8JRC7:(UIBarButtonItem*) aYM8JRC7 {
  159. NSLog(@"W1EmUDM0aqOHvsAk3");
  160. NSLog(@"hGRb8M962m4BNLco5VqzwyTODEf7");
  161. NSLog(@"m1ksv9cwy2JjP5zV83XIDq");
  162. NSLog(@"V65B7jRa2OAqHQJKEYevnshI8rGbi0Sg");
  163. NSLog(@"JOanAKEMU0LvHtXbF98Yoh");
  164. NSLog(@"avC1SNp9rl");
  165. NSLog(@"7R46fBg2KyuMonIrxSGaJbsimQUNHhwC");
  166. NSLog(@"oylX95VNTntx");
  167. NSLog(@"G5VSJCdjLwg2cO9E7ehz0ZX");
  168. NSLog(@"9Orv5f7zatsSRkmgionFIplL6TMXyjWdb3h");
  169. NSLog(@"skLJBnAFu9");
  170. NSLog(@"ibpENqK3cHLMU");
  171. NSLog(@"dBNQzL4RcpimbsZ1rMJ");
  172. NSLog(@"hGmcBHKP170iRIXq6lTag5Qr4oJbApdCfZ2ExuOY");
  173. }
  174. -(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 {
  175. NSLog(@"SUrpHqLsMg");
  176. NSLog(@"f1N50RVAJuIGkK3YrSyd");
  177. NSLog(@"tyvGpjcnEWai8S9FL3XsU5KD0TYVMPdC");
  178. NSLog(@"07blaRAh36QU9rLGIkxYEpZn");
  179. NSLog(@"oEnf5JlDpmxc9012Mj4FPVsWrRCqGZaBOL8uzT");
  180. NSLog(@"y4WrdTn2M6vsklUh3S5qJj1aiPcHpAGDwKIX9t");
  181. NSLog(@"FXQ6VlSmCs7w9rNvi82EMk");
  182. NSLog(@"lVfAgPFvJLyIUhKR");
  183. NSLog(@"p1X8njrY4eHshu9i5yPvo07NgMx6bUfVc");
  184. NSLog(@"5cuVoMfBnLrd4zbUP1gexZTjSK9DtRhJX7H0pvG");
  185. NSLog(@"QrYd8JA5GtOcFTiPq");
  186. NSLog(@"R0VXZpcwvkOy");
  187. }
  188. @end