//
//  screeningFirstView.m
//  Lighting
//
//  Created by 曹云霄 on 16/5/8.
//  Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//

#import "screeningFirstView.h"
#import "ScreeningFirstCollectionViewCell.h"

#define WIDTH self.frame.size.width

@implementation screeningFirstView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/



- (void)awakeFromNib
{
    [self uiConfigAction];
}

#pragma mark -UI
- (void)uiConfigAction
{
    
    self.classificationLayout.itemSize = CGSizeMake((WIDTH-120)/4, 35);
    self.classificationLayout.minimumLineSpacing = 30;
    self.classificationLayout.minimumInteritemSpacing = 10;
    self.classificationLayout.sectionInset = UIEdgeInsetsMake(20, 20, 20, 20);
    [self.classificationCollectionView registerClass:[ScreeningFirstCollectionViewCell class] forCellWithReuseIdentifier:@"cell"];
    self.classificationCollectionView.dataSource = self;
    self.classificationCollectionView.delegate = self;
    
}


- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    ScreeningFirstCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
    cell.titleLabe.text = @"壁灯";
    return cell;
    
}

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return 20;
}

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
    NSLog(@"%d",indexPath.item);
}




@end
