123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- //
- // HomePageSubViewController.m
- // LN_School
- //
- // Created by 张嵘 on 2019/7/16.
- // Copyright © 2019 Danson. All rights reserved.
- //
- #import "HomePageSubViewController.h"
- #import "HomePageViewController.h"
- #import "StudentDetailViewController.h"
- @interface HomePageSubViewController ()
- @end
- @implementation HomePageSubViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- self.view.backgroundColor = UIColor.whiteColor;
- HomePageViewController *mainVC = (HomePageViewController*)self.parentViewController;
- HDSectionModel *subSecModel = mainVC.homePageViewModel.subViewControllerSecArr.firstObject;
- subSecModel.headerObj = _homePageNumHeaderModel;
- [self.collectionV hd_setAllDataArr:@[subSecModel].mutableCopy];
- self.collectionV.collectionV.scrollEnabled = NO;
- self.collectionV.collectionV.showsVerticalScrollIndicator = NO;
- self.collectionV.collectionV.showsHorizontalScrollIndicator = NO;
-
- /// 点击回调
- __weak typeof(self) weakS = self;
- [self.collectionV hd_setAllEventCallBack:^(id backModel, HDCallBackType type) {
- if (type == HDCellCallBack) {
- [weakS clickCell:backModel];
- }else if (type == HDSectionHeaderCallBack){
- [weakS clickHeader:backModel];
- }
- }];
- }
- - (void)clickCell:(HDCellModel*)cellM {
- NSLog(@"点击了%zd--%zd cell",cellM.indexP.section,cellM.indexP.item);
- StudentDetailViewController *vc = [[StudentDetailViewController alloc] init];
- [self navPushHideTabbarToVC:vc];
- }
- - (void)clickHeader:(HDSectionModel*)secM {
- NSLog(@"点击了段头");
- }
- @end
|