iOS CollectionView 封装演变 (3.)

基于《iOS CollectionView 封装演变 (2.)》的基础上封装得到的。

#import "YCHomeVC.h"

#import "YCHomeViewADCollectionSectionItem.h"
#import "YCHomeViewVideoHeadCollectionSectionItem.h"
#import "YCHomeViewVideoCollectionSectionItem.h"
#import "YCHomeViewNewsHeadCollectionSectionItem.h"
#import "YCHomeViewNewsCollectionSectionItem.h"

#import "LQSCollectionViewSection.h"

@interface YCHomeVC ()

@end

@implementation YCHomeVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.lqs_backgroundColor = CommonViewControllerBackgroundColor;
    
    LQSCollectionViewSection *collectionView = [LQSCollectionViewSection new];
    collectionView.collectionDataSource = [self collectionDataSource];
    
    [self lqs_boxControllerWithFillView:collectionView];
}


- (NSArray *) collectionDataSource {
    NSMutableArray *keepArray = [NSMutableArray array];
    {
        YCHomeViewADCollectionSectionItem *item = [YCHomeViewADCollectionSectionItem new];
        [keepArray addObject:item];
    }
    {
        YCHomeViewVideoHeadCollectionSectionItem *item = [YCHomeViewVideoHeadCollectionSectionItem new];
        [keepArray addObject:item];
    }
    {
        YCHomeViewVideoCollectionSectionItem *item = [YCHomeViewVideoCollectionSectionItem new];
        [keepArray addObject:item];
    }
    {
        YCHomeViewNewsHeadCollectionSectionItem *item = [YCHomeViewNewsHeadCollectionSectionItem new];
        [keepArray addObject:item];
    }
    {
        YCHomeViewNewsCollectionSectionItem *item = [YCHomeViewNewsCollectionSectionItem new];
        [keepArray addObject:item];
    }
    return keepArray;
}

@end