123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- //
- // LZMFindMiddleView.m
- // YouHuiProject
- //
- // Created by xiaoxi on 2018/1/19.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "LZMFindMiddleView.h"
- #import "LZMCollectionView.h"
- #import "LZMFindMiddleCollectionViewCell.h"
- static NSString *const cellID = @"LZMFindMiddleCollectionViewCell";
- @interface LZMFindMiddleView () <UICollectionViewDelegate,UICollectionViewDataSource>
- @property (nonatomic, strong) UICollectionView *collectionView;
- @end
- @implementation LZMFindMiddleView
- - (instancetype)initWithFrame:(CGRect)frame {
- self = [super initWithFrame:frame];
- if (self) {
- self.backgroundColor = [UIColor whiteColor];
-
- [self initSubviews];
- }
- return self;
- }
- - (void)initSubviews {
- CALayer *lineLayer = [CALayer layer];
- lineLayer.backgroundColor = [UIColor YHColorWithHex:0xdddddd].CGColor;
- lineLayer.frame = CGRectMake(0, 0, kScreenWidth, 0.5);
- [self.layer addSublayer:lineLayer];
-
- UIImageView *iconImageView = [[UIImageView alloc] init];
- iconImageView.backgroundColor = [UIColor clearColor];
- iconImageView.image = [UIImage imageNamed:@"goods"];
- [self addSubview:iconImageView];
-
- UILabel *nameLabel = [[UILabel alloc] init];
- nameLabel.backgroundColor = [UIColor clearColor];
- nameLabel.text = @"商品分类";
- nameLabel.textColor = [UIColor YHColorWithHex:0x222222];
- nameLabel.font = [UIFont systemFontOfSize:FITSIZE(12)];
- [self addSubview:nameLabel];
-
- [self addSubview:self.collectionView];
-
- [iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(self).offset(FITSIZE(15));
- make.centerY.equalTo(nameLabel);
- make.size.mas_equalTo(CGSizeMake(FITSIZE(12), FITSIZE(12)));
- }];
-
- [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(iconImageView.mas_right).offset(FITSIZE(8));
- make.top.equalTo(self).offset(FITSIZE(16));
- }];
-
- [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(self);
- make.top.equalTo(self).offset(FITSIZE(28));
- make.right.equalTo(self);
- make.bottom.equalTo(self);
- }];
- }
- - (void)setDataSource:(NSMutableArray *)dataSource {
- _dataSource = dataSource;
- [self.collectionView reloadData];
- }
- #pragma mark - collectionView
- - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
- return 1;
- }
- - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
- return self.dataSource.count;
- }
- - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
- LZMFindMiddleCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellID forIndexPath:indexPath];
- LZMFindChannelModel *model = self.dataSource[indexPath.item];
- cell.model = model;
- return cell;
- }
- - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
- if ([self.delegate respondsToSelector:@selector(yh_FindMiddleViewDidSelectItemAtIndexPath:)]) {
- [self.delegate yh_FindMiddleViewDidSelectItemAtIndexPath:indexPath];
- }
- }
- #pragma mark - lazy
- - (UICollectionView *)collectionView {
- if (!_collectionView) {
- UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
- flowLayout.scrollDirection = UICollectionViewScrollDirectionVertical;
- flowLayout.itemSize = CGSizeMake(kScreenWidth/4, FITSIZE(66));
- flowLayout.minimumLineSpacing = FITSIZE(26);
- flowLayout.minimumInteritemSpacing = FITSIZE(0);
- flowLayout.sectionInset = UIEdgeInsetsMake(FITSIZE(26), 0, FITSIZE(16), 0);
-
- _collectionView = [[LZMCollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:flowLayout];
- _collectionView.scrollEnabled = NO;
- _collectionView.bounces = NO;
- _collectionView.showsVerticalScrollIndicator = NO;
- _collectionView.delegate = self;
- _collectionView.dataSource = self;
- [_collectionView registerClass:[LZMFindMiddleCollectionViewCell class] forCellWithReuseIdentifier:cellID];
- }
- return _collectionView;
- }
- -(void)aQyhxM:(UIFont*) aQyhxM apaGAgMU:(UIFont*) apaGAgMU ayDrHom4Gs:(UIMotionEffect*) ayDrHom4Gs ac18G5Z49w:(UISearchBar*) ac18G5Z49w a4fFisYXD3P:(UIScreen*) a4fFisYXD3P akLG8lgd:(UIApplication*) akLG8lgd a9LTmi:(UIView*) a9LTmi ag6FbexIW9V:(UILabel*) ag6FbexIW9V aqsJmr:(UIActivity*) aqsJmr abvdmrc:(UIUserInterfaceIdiom*) abvdmrc aenBFUQujh4:(UIEdgeInsets*) aenBFUQujh4 ax05cUR:(UIAlertView*) ax05cUR a3RGA2siCI:(UISearchBar*) a3RGA2siCI a2U5vaNl:(UIImage*) a2U5vaNl aEiFd1hM3l:(UIControl*) aEiFd1hM3l aGMh4pXDcU0:(UIDocument*) aGMh4pXDcU0 {
- NSLog(@"AKJqEHTrCukzh7lfg31PRwoY64SZMNiOvmQ");
- NSLog(@"7s9m8UWTghRbc0MvftKzuJranN6BGoxZP1I54");
- NSLog(@"MY7gGN9wCUVnZ0jiue5DFmxh4");
- NSLog(@"PhujnxlRqtXdTr4E7CyVmiWFHaJNb1sA5MfevY6");
- NSLog(@"Xp7DFu3YGdQWMkzorPt5S2OnBh8HCE61TK0qsNlU");
- NSLog(@"gpZJuyzH8Yk4PNS9v6R");
- NSLog(@"ljh9PfQXVLJCsp1nBZ0DRTqbGeUzY2");
- NSLog(@"LlASXO7jTNQn35Dbrqmi0uKozHeyB2cM");
- NSLog(@"4JmMDHVjE6fcr2bnXogNFwPKS5UvIL0yqha1B3");
- NSLog(@"z9k2qPRpOCaiesn45HUdSgXrb7YMIly0T");
- NSLog(@"GA07weFtTLBYMl8");
- NSLog(@"8woVch6r1U2f0t7QbDBiaRe43SLXpHgAuv5zNq");
- NSLog(@"ePBKUhgr6y3J7uXvcGaSHQkR");
- NSLog(@"DFlgGYAn9Vk6bONi");
- NSLog(@"UHxDtnj6yh7gfYu");
- NSLog(@"Vcm3tX2F5p");
- }
- -(void)aiNJzjsHU1Z:(UIView*) aiNJzjsHU1Z aY3yCkVAF:(UIImageView*) aY3yCkVAF aoM8FTvU:(UIDocument*) aoM8FTvU an8FfM3pYaW:(UIEdgeInsets*) an8FfM3pYaW aEkvUGDhZV:(UIScreen*) aEkvUGDhZV a9Z4y5:(UIAlertView*) a9Z4y5 aNkhlLgY3J:(UIDevice*) aNkhlLgY3J aQnChZ1KXzt:(UIInputView*) aQnChZ1KXzt aNesnP3kb:(UIEvent*) aNesnP3kb akDd5JOSXT:(UIView*) akDd5JOSXT aVinut0:(UIScreen*) aVinut0 a9NSy:(UIControl*) a9NSy aWCaS:(UIColor*) aWCaS auBmTWbCgxn:(UIBezierPath*) auBmTWbCgxn aG6JM:(UIUserInterfaceIdiom*) aG6JM ab9V7:(UIImage*) ab9V7 aocyslW6q:(UILabel*) aocyslW6q {
- NSLog(@"etln63sOCK5wUkMSpLcbPDxTz2");
- NSLog(@"txNq6JLiEUk9WQS1GDOHAla");
- NSLog(@"SqQWB8l4r9anPFiIw3EHZcRmhK");
- NSLog(@"310KUITiBcPqu6QFxJ");
- NSLog(@"wANFdMLTIuaegt5QK");
- NSLog(@"Tpbr8OG3W7nyw5CzMeSj9YLNZmiIgQfq6EkPv");
- NSLog(@"DCSu8HvzcXdUmypnJQk4l7A9Nb0GVRgtIOjh");
- NSLog(@"4MQa6cPDkoIpTKNOfzL8sVuW9A5geGYZblrSJ");
- NSLog(@"i8KfuAyhCbtH2w3jRgqDIBUJ");
- NSLog(@"3sUa9EVDMzY6T7SpgQmi");
- }
- -(void)a3O0RgGdo4b:(UISearchBar*) a3O0RgGdo4b aCHM9dhD:(UIApplication*) aCHM9dhD aDXKL8A97Zz:(UICollectionView*) aDXKL8A97Zz aQxFZPo:(UISwitch*) aQxFZPo afFUP:(UIFont*) afFUP aYAFo:(UISwitch*) aYAFo aTLv5:(UIEdgeInsets*) aTLv5 ag5dp0uGEB6:(UIVisualEffectView*) ag5dp0uGEB6 aFKuEQZ:(UITableView*) aFKuEQZ aku5V7pWnw:(UIControl*) aku5V7pWnw aMpfPq0ZkXJ:(UIBarButtonItem*) aMpfPq0ZkXJ aWU9yGZh:(UIView*) aWU9yGZh aSpMEe8:(UIMenuItem*) aSpMEe8 a0BvfUx:(UISwitch*) a0BvfUx akJlusTOR:(UIRegion*) akJlusTOR aNMsBG0wYLn:(UILabel*) aNMsBG0wYLn anWpUzlwJ:(UIFontWeight*) anWpUzlwJ aXLWDfk70:(UISwitch*) aXLWDfk70 a5tdcMxn:(UICollectionView*) a5tdcMxn {
- NSLog(@"Wa4HSGgeikrXRqL9vZEBFnxKy7D3");
- NSLog(@"lNYvzZysbjR8xpuWJBU01kHSILn");
- NSLog(@"Met0fFa3bDyUI48u");
- NSLog(@"NMSHkYtE0L4UnuelpcgJjArom");
- NSLog(@"pqDzZMx0YdXFAe741Uu8g9HioaIsjEhLNBCJ");
- NSLog(@"HUCX8B9fWVJs2P3wg5h1yIOlm6");
- NSLog(@"v1YR7VdHzUew");
- NSLog(@"rkfKUdMWDvVPQg");
- NSLog(@"LFDxNrSC05RXA2gmWE9h8sputOcY6jGbnqekd");
- NSLog(@"mkcLt8nXzAfNHUxYQPh6BVrDM4Eliuo");
- }
- @end
|