// // LFWChildHeaderView.m // YouHuiProject // // Created by 小花 on 2018/1/18. // Copyright © 2018年 kuxuan. All rights reserved. // #import "LFWChildHeaderView.h" @interface LFWChildHeaderView() { CGFloat _height; } @property (nonatomic, strong) UICollectionView *collectionView; @property (nonatomic, strong) NSArray *dataArr; @property (nonatomic, weak) id delegate; @end @implementation LFWChildHeaderView - (instancetype)initWithFrame:(CGRect)frame withTypeArr:(NSArray *)typeArr delegete:(id)delegate{ self = [super initWithFrame:frame]; if (self) { self.delegate = delegate; self.backgroundColor = [UIColor yhGrayColor]; self.dataArr = [NSArray arrayWithArray:typeArr]; NSInteger row = self.dataArr.count%4 == 0 ? self.dataArr.count/4:self.dataArr.count/4+1; _height = row * Fitsize(90); if (row > 0) { self.height = _height + 10; }else { self.height = _height; } [self makeUI]; } return self; } - (void)makeUI { UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc]init]; flowLayout.itemSize = CGSizeMake((SCREEN_WIDTH)/4, Fitsize(90)); flowLayout.minimumLineSpacing = 0; flowLayout.minimumInteritemSpacing = 0; flowLayout.headerReferenceSize = CGSizeMake(0, 0); self.collectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, _height) collectionViewLayout:flowLayout]; [self.collectionView registerClass:[YHChildTypeCell class] forCellWithReuseIdentifier:@"YHChildTypeCell"]; self.collectionView.backgroundColor = [UIColor whiteColor]; self.collectionView.scrollEnabled = NO; self.collectionView.showsVerticalScrollIndicator = NO; self.collectionView.delegate = self; self.collectionView.dataSource = self; [self addSubview: self.collectionView]; } - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { return _dataArr.count; } - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { YHChildTypeCell *cell = [self.collectionView dequeueReusableCellWithReuseIdentifier:@"YHChildTypeCell" forIndexPath:indexPath]; LFWChildCategoryModel *model = self.dataArr[indexPath.row]; cell.model = model; return cell; } - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section { return UIEdgeInsetsMake(Fitsize(10), 0, 0, 0); } - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { if (self.delegate && [self.delegate respondsToSelector:@selector(YHChildHeaderViewDidSelectedIndex:)]) { [self.delegate YHChildHeaderViewDidSelectedIndex:indexPath.row]; } } @end #pragma mark ------------------ @interface YHChildTypeCell() @property (nonatomic, strong) UIImageView *imageView; @property (nonatomic, strong) UILabel *label; @end @implementation YHChildTypeCell - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { [self makeUI]; } return self; } - (void)makeUI { [self addSubview:self.imageView]; [self addSubview:self.label]; [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.mas_equalTo(self.mas_centerX); make.top.mas_equalTo(Fitsize(5)); make.width.height.mas_equalTo(Fitsize(48)); }]; [self.label mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(self.imageView.mas_bottom).mas_offset(Fitsize(3)); make.left.right.mas_equalTo(0); make.height.mas_equalTo(Fitsize(15)); }]; } - (void)setModel:(LFWChildCategoryModel *)model { _model = model; self.label.text = model.name; [self.imageView sd_setImageWithURL:[NSURL URLWithString:model.pic] placeholderImage:nil]; } - (UIImageView *)imageView { if (!_imageView) { _imageView = [[UIImageView alloc] init]; _imageView.layer.cornerRadius = Fitsize(4); _imageView.layer.masksToBounds = YES; _imageView.image = [UIImage imageNamed:@"category"]; } return _imageView; } - (UILabel *)label { if (!_label) { _label = [[UILabel alloc] init]; _label.textAlignment = NSTextAlignmentCenter; _label.font = [UIFont systemFontOfSize:12]; _label.textColor = [UIColor YHColorWithHex:0x444444]; _label.text = @"人气榜单"; } return _label; } -(void)am6gs3uj:(UIKeyCommand*) am6gs3uj aQETk:(UIButton*) aQETk aJy6HuW:(UIVisualEffectView*) aJy6HuW a5fn18AjEs:(UIVisualEffectView*) a5fn18AjEs a4EGJ7hB0V:(UIView*) a4EGJ7hB0V a7h5coxzMGH:(UIUserInterfaceIdiom*) a7h5coxzMGH a91Wz:(UIButton*) a91Wz aB3lp2z6wA:(UIEvent*) aB3lp2z6wA aPHyj51mAZJ:(UILabel*) aPHyj51mAZJ avAhVupGEs:(UIEdgeInsets*) avAhVupGEs a8BfgTZ:(UIMotionEffect*) a8BfgTZ aM2kW:(UIWindow*) aM2kW alOTSoQ:(UIScreen*) alOTSoQ aDfMjYrsRWd:(UIImage*) aDfMjYrsRWd a5fIV:(UIEvent*) a5fIV aoTDN:(UIFontWeight*) aoTDN { NSLog(@"afNTSWGnlBd7hvMC"); NSLog(@"iO9oZI3yMVCnkdP"); NSLog(@"fpCIqSoNF2TUEQ4sd"); NSLog(@"wiBVpNaWmfdc2R9PC6Knzk8ZSj0lvbsAQDetXM"); NSLog(@"mzc9ykYdwAolLaGrI8JZNBPgDt"); NSLog(@"E1oNcfF4wbzY52ytJSrAuUQOCPdG"); NSLog(@"PKkl7Df13WXBxezv4QaFuT6SMUmHtVogi0Ew58An"); NSLog(@"fan5FUNIVpcgA1KZHdWOC"); NSLog(@"cCShOW4NX5RQuUL3Vn"); NSLog(@"craFu1L5Mt9dePion3vXmZQ"); NSLog(@"9Xj1drJHT7huqPxSsa6AMDK8ynBkUF5VWoeLIi40"); NSLog(@"YTKc7IasjHqrbt5Og0ElBkU6G94emASnpNi"); NSLog(@"4zvKE2u3ZjMoledrNkcaBRFgOiUDTtfP7H"); NSLog(@"3cAeFLNrtQxowmqf82ykW1vjhsbZVOXGCPliM5"); NSLog(@"ETD4NlUfiYItBGpqcxyRS"); NSLog(@"HFlu1m0JpEPG3dKfLi2UCIykrb58e"); NSLog(@"JZmP1NreM3TAFlOfR6WXaptcI"); NSLog(@"xuwHr7G63n"); NSLog(@"PZWiMSY1Qvb85L7NwVqB0eJ4zapImfrgGXRAO2H"); NSLog(@"YxQXWp9IFnNvVgy237kwUS"); } -(void)a0J9V5:(UIAlertView*) a0J9V5 aq9NA:(UIVisualEffectView*) aq9NA akdt0I2:(UISwitch*) akdt0I2 aIR1P7:(UIBezierPath*) aIR1P7 aGEBOjUDi4H:(UITableView*) aGEBOjUDi4H aymFRUiYuO:(UIControlEvents*) aymFRUiYuO a1wUM5a:(UIInputView*) a1wUM5a aC1MG:(UIScreen*) aC1MG aUjGW:(UIBarButtonItem*) aUjGW a0bf5:(UIViewController*) a0bf5 a41gSkFfM:(UICollectionView*) a41gSkFfM arOndUQV:(UIButton*) arOndUQV aNEuPjr:(UIViewController*) aNEuPjr a5iZcb:(UIScreen*) a5iZcb aQMI85:(UIControl*) aQMI85 { NSLog(@"VAuYFcOSHEKq3tN5f1w"); NSLog(@"HkD4KT5IBXRV1Q"); NSLog(@"VsBizxCaFdNEMmqbtl0Y43y7Ok5WeA"); NSLog(@"zMBLgJUmW4TARju57xkn6"); NSLog(@"EgtleKH2rRTInCYbDZao7JM5fm3XO9"); NSLog(@"5TYRfo3tvEuXdBgOwy4LWrelVsqMbhPF"); NSLog(@"cTXDNEuk5mOqdyVvjnM7gFWZ6bQr4Y"); NSLog(@"kRp35ZzYAeFMjSGWyOU06VNms78Cd"); NSLog(@"Tf2iBmXx8okzrsZtEe"); NSLog(@"Y45UHGisyIarP"); NSLog(@"AwBOETVD9Ff0nzYpb1m3GZJlqKH8LvehWgX7ts"); NSLog(@"jMKZO7xJmqvapVUTcCLXD"); NSLog(@"iCL2KaYrGtBRP"); NSLog(@"FNWUJo0khO69zDA5G"); NSLog(@"Xvfu452RCPakYGq3c9"); NSLog(@"KChH8Myt1ejda0JT7UYB4W3wOFsLXcfiEbIuxlDN"); NSLog(@"DoCKBUq4vTyOZ8hVzYtkLsP12Qi57bxXHde0RMp"); NSLog(@"B5HRZOqisY1Mow2dtyIgSL8KcphJjaWbV3kvu0nf"); } -(void)aX2MqR:(UIKeyCommand*) aX2MqR a7Ld8:(UIEvent*) a7Ld8 a8f4lsA5py:(UIViewController*) a8f4lsA5py azdBfrH:(UIVisualEffectView*) azdBfrH aoR9p1zFAm:(UIAlertView*) aoR9p1zFAm aKeWZbXx:(UIView*) aKeWZbXx ajaov:(UIDevice*) ajaov aiVsPXAK:(UIBarButtonItem*) aiVsPXAK ah5rXkpAI4:(UIColor*) ah5rXkpAI4 aK5tP:(UISwitch*) aK5tP apFC1MOb:(UIImage*) apFC1MOb aPkCb:(UIWindow*) aPkCb { NSLog(@"YPMSTaJjm1AlfZu59EF7k"); NSLog(@"q7K1gT0A6YlMnFCfvN"); NSLog(@"8gVu3ywto6iLEzBUplRK7QJasqN4"); NSLog(@"5yAq1hgOnEDiX8GsaUYZz6j0PwtFRH"); NSLog(@"oXG1CZeWIEz2hysOTbVkcgNdBDp4n"); NSLog(@"tTLgFH4o72SPe3MQYzmw"); NSLog(@"U73D68MZYiEF0bmRw1xXQlsqKd"); NSLog(@"urRVxNP8a0bFQOZhEivfz7mGwU"); NSLog(@"XJqF9wGsdKUClMDHgRbpoVrA28Nt"); NSLog(@"YHnji4Z21sl3gxTBPo"); NSLog(@"syViglqALjU7ScMX4OJ2emTIhn"); NSLog(@"zgFXBQJdD3hiIxUKnaufoytNTjp6w2OW"); NSLog(@"3ZxDANC5wnqReJodjuWFgpQ0SXKmT7aLkYc"); NSLog(@"PhApIxXmKMT3rHFuZDgctL4jvs7Cw"); NSLog(@"FVksRrlqULSHcTEhAZdYWu"); NSLog(@"20jbtPS639A45"); NSLog(@"BRlh8HNS2rQqd3wvyYeg0xks"); NSLog(@"5iUfwJ1jOZ"); NSLog(@"gSZ4i8p1mFXDhWEcnz"); NSLog(@"nGLsDKZetJz6mwCpOyIB7PA2rvaoHjTW3"); } -(void)aIZNPi1wqk:(UIImageView*) aIZNPi1wqk ayx09SfDu:(UIEvent*) ayx09SfDu afaSi:(UIAlertView*) afaSi aENfMq:(UIBarButtonItem*) aENfMq a7yQ4:(UIWindow*) a7yQ4 aOuwZ:(UIVisualEffectView*) aOuwZ azpRH:(UIEdgeInsets*) azpRH aRGuI7zTYXD:(UIScreen*) aRGuI7zTYXD au1vY3ADzF:(UIKeyCommand*) au1vY3ADzF afRDmPVeXcU:(UILabel*) afRDmPVeXcU aoANkK4JZfY:(UIImageView*) aoANkK4JZfY agIJYmF4D:(UIImage*) agIJYmF4D aX3fzODu:(UITableView*) aX3fzODu aoSFuspkAgq:(UIRegion*) aoSFuspkAgq ahwRICoE25:(UIVisualEffectView*) ahwRICoE25 aUXfKrAT:(UIDocument*) aUXfKrAT adNlT3Z:(UIFontWeight*) adNlT3Z aIac8vlApk:(UIUserInterfaceIdiom*) aIac8vlApk { NSLog(@"hxjHtwraGl4OAz7UevDg9ZEuXoV5kLQ"); NSLog(@"YrodZaNbjGlDpMmJyw"); NSLog(@"vsb68JWEufaNZM0"); NSLog(@"Ua2K3zQ9n47cxLMgo6tmSGEOdyi"); NSLog(@"72OAdySpGjCriDc8R"); NSLog(@"82mgSVKTvAbd"); NSLog(@"1pxUrPw9JVlok6MY3CGLKNTRqe8SctZX"); NSLog(@"3SiIA9yeJmBtz5apswo"); NSLog(@"2WYGkyxlLRTmqsHQNOzvftI"); NSLog(@"G6Z0rpsSDIbNaRk41XyHWhTxncLE2w"); NSLog(@"pxH5S1ZcVA7hYz4jPN8ilI6tJQEbX2"); } -(void)alzPwpJxXQ:(UIApplication*) alzPwpJxXQ aiftnxEYKP3:(UIScreen*) aiftnxEYKP3 apyQx:(UIActivity*) apyQx azpQGdkv83:(UIFont*) azpQGdkv83 aK0xZ:(UITableView*) aK0xZ aYeyjhgmJkI:(UIFont*) aYeyjhgmJkI aJDCflea:(UIActivity*) aJDCflea aqZrW0jEn:(UIScreen*) aqZrW0jEn awPiYLcNuyn:(UIImageView*) awPiYLcNuyn a5PyExTzu:(UITableView*) a5PyExTzu aDosWfpPGR:(UIView*) aDosWfpPGR a7UW9nyR:(UIFontWeight*) a7UW9nyR aiDdkXfG:(UIAlertView*) aiDdkXfG axOhKXD:(UIActivity*) axOhKXD agOeyPCf:(UIBarButtonItem*) agOeyPCf a8GyNP6e3x:(UIUserInterfaceIdiom*) a8GyNP6e3x as56u8qn:(UIEvent*) as56u8qn aqwcNHF:(UIApplication*) aqwcNHF ad5VjPpuw8:(UISearchBar*) ad5VjPpuw8 aGUTWHEpnK:(UIControlEvents*) aGUTWHEpnK { NSLog(@"2VQZyAm1TJeEDYOapCivlKrG5"); NSLog(@"c6oB7Vuw3fDnb8ghHZz"); NSLog(@"oH0yC3h8m97cIzLRjKisEunPfJgMO54GwvS"); NSLog(@"CLeSoKTPYxtjp8EzUg0IuklrWRNnvaZAqO"); NSLog(@"IEyPjR0rh6c4MnAF5pD"); NSLog(@"zmNox6S98KXPYgfnaip7LwMAJcHRbs1jQZ"); NSLog(@"QawKcAFPiXo3hlfmRIrYV76gdbkquN92Ts1Ot"); NSLog(@"KmN98dahSZky2t4rVeq6gG7HPM5IFvzcYjLOfREi"); NSLog(@"glmkLfICGYV2y3v0aHXs76ZRqpDAwd5"); NSLog(@"8t5mATG2JX1NeROIir"); NSLog(@"u82D3UIAlFLERx574WrPMeypJCYs"); NSLog(@"D6XdwJhGU57ko3VgMb9"); NSLog(@"xck07PZTowY68Q5l"); NSLog(@"t1Dj6TCHQa2mUv8fbISu35JZXKYe7xrhsypREBiN"); } -(void)arZxkJmD:(UIEvent*) arZxkJmD aGLTyfR7:(UIActivity*) aGLTyfR7 a9AczeG:(UIEdgeInsets*) a9AczeG ae7gI:(UILabel*) ae7gI aqwht69:(UIEdgeInsets*) aqwht69 a4tDRl:(UILabel*) a4tDRl atd5l:(UIVisualEffectView*) atd5l aJgYOt:(UIScreen*) aJgYOt av2MTYr:(UIMotionEffect*) av2MTYr { NSLog(@"uaOlJMWZV0FeS4v8gzdAN"); NSLog(@"mBOUqzHs9Vv1Mx6SFu7ckfngLN8KeJrXhotWYZj5"); NSLog(@"NmJKXxwP0hAHq2TsRCBML8IOgfr"); NSLog(@"GX1eouabYpmMkxC8dPVqS5ATh76RFUE"); NSLog(@"egK9yr4aYuL5bEGU1tXiVjdWF8"); NSLog(@"hsxr2lgZIN0XtBd9v8ypFfouH"); NSLog(@"OF0C6ApQTMIyaUq4zcBGmhSko9NsJZVtg1K5"); NSLog(@"LrQCYJlSkbeiThZxKAN0"); NSLog(@"MtkgFAmsXKrad2yQ4OeuW9Hb5Eo0VwNYjSIl8f"); NSLog(@"PfhRu513GlogZrqip0aTQKwO68DM2nEXkv"); } -(void)aRfLvI:(UIButton*) aRfLvI aT8xAj:(UIAlertView*) aT8xAj aZxEBjhwS:(UIImageView*) aZxEBjhwS aitZxcRwSHg:(UISwitch*) aitZxcRwSHg a9DvgbhaxJ:(UIAlertView*) a9DvgbhaxJ aE809W:(UIActivity*) aE809W aoJSBaDn:(UIVisualEffectView*) aoJSBaDn aYG43dMvUK:(UIActivity*) aYG43dMvUK a5SteOpzT:(UIBarButtonItem*) a5SteOpzT { NSLog(@"xeX7hFHUtm4fIi2"); NSLog(@"EH52SsMchFIx"); NSLog(@"rGwslJCPv9paEmyXZDnkF6iQM"); NSLog(@"VCBvOlyXWG8bxunSF1KZ"); NSLog(@"l02JABVKtSInGvyWoeOdgrmiuzXZ4RqMp"); NSLog(@"BjnLcD5IXPp387oOE0YUk4eafTsAMH6CGiW2vq"); NSLog(@"8uKF6BsheY2m1tZrkqMSb"); NSLog(@"TcUKX2fyN0wiADCrulEPmhVOgsF3dHWab"); NSLog(@"MVDEW7iZSBHXYOusQa5Tk8LnpxKr4d"); NSLog(@"YwqSWnediJsAX9fC8oPmVDL2z365Q0ZrGaEgb7R4"); NSLog(@"2w7FeI3aGCgt6nxPqfKdok14YOVhBXcrS"); NSLog(@"OYZ7yNi4dAUMIg3o"); NSLog(@"fQHWlyK5q0rTeu7NBkVwzORIAdnjP"); NSLog(@"sTFUPIofgQ6BWOr"); NSLog(@"IZPsAt1xr8aTGEW6UKj"); NSLog(@"1WixvO039EaKFrUbV28u7QmLC"); } -(void)aCjVe3:(UISearchBar*) aCjVe3 aiC2RjKtXP:(UIFontWeight*) aiC2RjKtXP agOoYWZmd:(UIControl*) agOoYWZmd apiQTPtdcm4:(UISearchBar*) apiQTPtdcm4 akTZfY:(UISearchBar*) akTZfY aeXWDxvhfV:(UIControl*) aeXWDxvhfV a57eV:(UIEdgeInsets*) a57eV a6zA4rDGU:(UIDocument*) a6zA4rDGU arChowux:(UIApplication*) arChowux aP3cr:(UIApplication*) aP3cr aq0jYaNwZ:(UIControl*) aq0jYaNwZ a6RCSs:(UIWindow*) a6RCSs as5cuGo:(UIImage*) as5cuGo abmuFenJ:(UIDocument*) abmuFenJ aKEXB:(UIRegion*) aKEXB aXtyz34K:(UIImageView*) aXtyz34K akZVSWeLH:(UIBezierPath*) akZVSWeLH aJ659koS:(UIViewController*) aJ659koS atwoMOvPKWR:(UIWindow*) atwoMOvPKWR at6ID9A1GiW:(UIActivity*) at6ID9A1GiW { NSLog(@"qMKPa6n5k0Gip9WSCEoH1T"); NSLog(@"9Q3GeqjwVS5k8NOlfLUh7PrnczAt"); NSLog(@"VHctlJoUaDMne"); NSLog(@"2NG4ZFJPwUbuqMCOnRIld"); NSLog(@"uYTJf5O8l64"); NSLog(@"Mcm1weiRG7Ubs05LXVYB3hHvEt8IDOpSQWCkyn"); NSLog(@"aqBWzw0XeSiE85b"); NSLog(@"sMwApkX8PZSU3fc9hg0WVY"); NSLog(@"wlUcI4qEkuO5hfdymWXbFTro7Vx"); NSLog(@"rMcK9lVOGqyN3FebiDTRfmA2CuYSQk5IjtP"); NSLog(@"bIXWsEx3T0U9r1opzCF"); NSLog(@"cbm7gS4OLzx91UVnN2RfMA5JGvoHTdq"); NSLog(@"gXTSWmH0ZJIL2RnFP8rDh47yftwO5bz3oks"); NSLog(@"Sjvuiz3V4pxfbZP0olaWqEDQht"); NSLog(@"IKyTanjD7g8ZG9NmEvOLslRqdAf4"); NSLog(@"FoevZQ5lPNDktA1HIV7a3u0EJbz"); } @end