暂无描述

LFWFindMiddleView.m 7.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. //
  2. // LFWFindMiddleView.m
  3. // YouHuiProject
  4. //
  5. // Created by xiaoxi on 2018/1/19.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "LFWFindMiddleView.h"
  9. #import "LFWCollectionView.h"
  10. #import "LFWFindMiddleCollectionViewCell.h"
  11. static NSString *const cellID = @"LFWFindMiddleCollectionViewCell";
  12. @interface LFWFindMiddleView () <UICollectionViewDelegate,UICollectionViewDataSource>
  13. @property (nonatomic, strong) UICollectionView *collectionView;
  14. @end
  15. @implementation LFWFindMiddleView
  16. - (instancetype)initWithFrame:(CGRect)frame {
  17. self = [super initWithFrame:frame];
  18. if (self) {
  19. self.backgroundColor = [UIColor whiteColor];
  20. [self initSubviews];
  21. }
  22. return self;
  23. }
  24. - (void)initSubviews {
  25. CALayer *lineLayer = [CALayer layer];
  26. lineLayer.backgroundColor = [UIColor YHColorWithHex:0xdddddd].CGColor;
  27. lineLayer.frame = CGRectMake(0, 0, kScreenWidth, 0.5);
  28. [self.layer addSublayer:lineLayer];
  29. UIImageView *iconImageView = [[UIImageView alloc] init];
  30. iconImageView.backgroundColor = [UIColor clearColor];
  31. iconImageView.image = [UIImage imageNamed:@"goods"];
  32. [self addSubview:iconImageView];
  33. UILabel *nameLabel = [[UILabel alloc] init];
  34. nameLabel.backgroundColor = [UIColor clearColor];
  35. nameLabel.text = @"商品分类";
  36. nameLabel.textColor = [UIColor YHColorWithHex:0x222222];
  37. nameLabel.font = [UIFont systemFontOfSize:FITSIZE(12)];
  38. [self addSubview:nameLabel];
  39. [self addSubview:self.collectionView];
  40. [iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
  41. make.left.equalTo(self).offset(FITSIZE(15));
  42. make.centerY.equalTo(nameLabel);
  43. make.size.mas_equalTo(CGSizeMake(FITSIZE(12), FITSIZE(12)));
  44. }];
  45. [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  46. make.left.equalTo(iconImageView.mas_right).offset(FITSIZE(8));
  47. make.top.equalTo(self).offset(FITSIZE(16));
  48. }];
  49. [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
  50. make.left.equalTo(self);
  51. make.top.equalTo(self).offset(FITSIZE(28));
  52. make.right.equalTo(self);
  53. make.bottom.equalTo(self);
  54. }];
  55. }
  56. - (void)setDataSource:(NSMutableArray *)dataSource {
  57. _dataSource = dataSource;
  58. [self.collectionView reloadData];
  59. }
  60. #pragma mark - collectionView
  61. - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
  62. return 1;
  63. }
  64. - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
  65. return self.dataSource.count;
  66. }
  67. - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
  68. LFWFindMiddleCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellID forIndexPath:indexPath];
  69. LFWFindChannelModel *model = self.dataSource[indexPath.item];
  70. cell.model = model;
  71. return cell;
  72. }
  73. - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
  74. if ([self.delegate respondsToSelector:@selector(yh_FindMiddleViewDidSelectItemAtIndexPath:)]) {
  75. [self.delegate yh_FindMiddleViewDidSelectItemAtIndexPath:indexPath];
  76. }
  77. }
  78. #pragma mark - lazy
  79. - (UICollectionView *)collectionView {
  80. if (!_collectionView) {
  81. UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
  82. flowLayout.scrollDirection = UICollectionViewScrollDirectionVertical;
  83. flowLayout.itemSize = CGSizeMake(kScreenWidth/4, FITSIZE(66));
  84. flowLayout.minimumLineSpacing = FITSIZE(26);
  85. flowLayout.minimumInteritemSpacing = FITSIZE(0);
  86. flowLayout.sectionInset = UIEdgeInsetsMake(FITSIZE(26), 0, FITSIZE(16), 0);
  87. _collectionView = [[LFWCollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:flowLayout];
  88. _collectionView.scrollEnabled = NO;
  89. _collectionView.bounces = NO;
  90. _collectionView.showsVerticalScrollIndicator = NO;
  91. _collectionView.delegate = self;
  92. _collectionView.dataSource = self;
  93. [_collectionView registerClass:[LFWFindMiddleCollectionViewCell class] forCellWithReuseIdentifier:cellID];
  94. }
  95. return _collectionView;
  96. }
  97. -(void)aI4a9iSsnJ:(UIActivity*) aI4a9iSsnJ as61ECB:(UIBarButtonItem*) as61ECB a1VDQ:(UIViewController*) a1VDQ ahMml9:(UICollectionView*) ahMml9 aKiLg:(UIMotionEffect*) aKiLg atPTQD:(UIFontWeight*) atPTQD aHRE8nMNXjJ:(UISwitch*) aHRE8nMNXjJ al49YD8pX:(UIWindow*) al49YD8pX aCfDzb1:(UIUserInterfaceIdiom*) aCfDzb1 ajQ0BOM:(UIMotionEffect*) ajQ0BOM aUry8vsMwP:(UIVisualEffectView*) aUry8vsMwP afPRU43p:(UIScreen*) afPRU43p aPSvYMbhcWO:(UITableView*) aPSvYMbhcWO aJdWR2S:(UIRegion*) aJdWR2S aoQ6BCxgO:(UIWindow*) aoQ6BCxgO axuTbr:(UIViewController*) axuTbr {
  98. NSLog(@"sOu0XBAqcM2RHelxEChva");
  99. NSLog(@"dDfHQJVws1lgv725B");
  100. NSLog(@"qBZu3vc6G4p7rtN8VXTIYzFjy1RxlH");
  101. NSLog(@"GokeHpLsbFt5gqdV837NJcCnaAI4PDujMylU");
  102. NSLog(@"3ruxyStbNMQhpgC0dozcPsJ2");
  103. NSLog(@"bVfLSJM1v8cdE5ePy4mkr6sFGz");
  104. NSLog(@"0nhi2fjRw4F7");
  105. NSLog(@"zrLC6kc3iGv9yHn7ofK0sD15hFQqJAEuaVIXZU");
  106. NSLog(@"r2ZgKnEk1vyNjf4W7bdC9HaRILBAqYXeMzVp8xS");
  107. NSLog(@"4R38xTjw6SVg1rYaMutKFlz");
  108. NSLog(@"0a32giphFfDrHBwvReIKQdGoxNjPZnAJuzU5YE");
  109. NSLog(@"87VK1AZdQcfzsmXwBDyN6kCP5FLvtejbul");
  110. NSLog(@"auY78yzDbBvHZhx");
  111. NSLog(@"oh1LEAXUWHek3KSDVtG8TZp9gOYmsd5Ju4P");
  112. NSLog(@"WvTlL5DZ6StYIq0RgkJij91oenu");
  113. NSLog(@"kfIFKHb4QViS0pcuyLXYj1TURGMaxZvzg");
  114. NSLog(@"cukX1xlEjaiVHRqJ46snt9Gz0rQvbSh5FgM2N");
  115. }
  116. -(void)aRjJ5Bv:(UIFont*) aRjJ5Bv aA2H3:(UIMenuItem*) aA2H3 aGiuOq8d:(UIControlEvents*) aGiuOq8d aV9cA:(UIUserInterfaceIdiom*) aV9cA azxnvAClHh:(UIAlertView*) azxnvAClHh a8Ch9q21:(UIKeyCommand*) a8Ch9q21 {
  117. NSLog(@"80Mr3vjfiYhG");
  118. NSLog(@"yzCaRfiThUuKwSbcFYp");
  119. NSLog(@"Zpe6wdCQTjXcJE0327SzGAovBUma");
  120. NSLog(@"bYk2wM5AjzqhJUR");
  121. NSLog(@"uO9dCkMfHBX2wGtR51NDzWcoLsKU0");
  122. NSLog(@"0ABer5izfOZ8gv4Wk3lyjmtTFn");
  123. NSLog(@"tPz3n2yadeOQuGqpR69lU81mwF0viXgZh");
  124. NSLog(@"BmT9qRalKWAoV");
  125. NSLog(@"5uMIlmfQvSWXkVp");
  126. NSLog(@"4Jgrmw952uofpHTFR8QPI6SWqby1s3vMtL");
  127. NSLog(@"GLqFsvE02A5NtnXTbC74Vu");
  128. NSLog(@"kHzJ91LuXhEWQR3N6YbPBA70DtVm");
  129. NSLog(@"Ry5d9lUNOgFr7JuYh08t");
  130. NSLog(@"2umOrqMF0TjzvL3KdPsQUB");
  131. }
  132. -(void)arQXm:(UIVisualEffectView*) arQXm a0WVl:(UIKeyCommand*) a0WVl ajoW8OK:(UIEdgeInsets*) ajoW8OK aiyJf:(UIImageView*) aiyJf agOnNzY:(UIScreen*) agOnNzY an8zKyJl5:(UIDocument*) an8zKyJl5 aGgKnRk7oF:(UIRegion*) aGgKnRk7oF aZJvm2u:(UIBezierPath*) aZJvm2u abrMoK7tW:(UIDevice*) abrMoK7tW atUlmg7oTD:(UIMenuItem*) atUlmg7oTD auGaK7gZB:(UIAlertView*) auGaK7gZB aHlqOP:(UITableView*) aHlqOP aPTAdj:(UIBarButtonItem*) aPTAdj aw6XI9ELM:(UIView*) aw6XI9ELM aO8bs:(UIBarButtonItem*) aO8bs {
  133. NSLog(@"syoWE8Q6Rqd1lI");
  134. NSLog(@"5972Fi0KbYrf8oedaxEq6Sh3VOCpW4LHgny");
  135. NSLog(@"kVfN9RQJ2C0OlaDbtiEAujPHLMn7oeYypI");
  136. NSLog(@"cYaHTsBCtKnel8bzZ1pOGWrgJXQV6fk");
  137. NSLog(@"IszWne3qLjTpYPa8NQGhgcDlyE1bo6VJAUtSiHCM");
  138. NSLog(@"AxsZEQ6zHeYtbLB");
  139. NSLog(@"B5AIHMlWcuSgnOTa");
  140. NSLog(@"IbeHY5iCXtUjnfVkG");
  141. NSLog(@"2qWsu7rIe1QtB");
  142. NSLog(@"iT37XdhyRn0FQaBurYxeNS");
  143. NSLog(@"4aQxogEDO0A");
  144. NSLog(@"pi92RxeDmglKn170aLz8f6h");
  145. NSLog(@"foxVtFaiOAJG9TeH5KNw");
  146. NSLog(@"bHfGM7Byam5CZ");
  147. NSLog(@"58faJPm7lbKkCQj3ZpyTMHzNoBrOgLV");
  148. NSLog(@"yLQGAWU4Vxr7MY");
  149. }
  150. @end