BBAPanelGroupedGridView.h
1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// BBAPanelGroupedGridView.h
// BBAUIKit
//
// Created by Guo,Zhaozhuo on 2020/3/30.
// Copyright © 2020 Baidu. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "BBAPanelCommon.h"
#import "BBAPanelItem.h"
#import "BBAPanelGridGroupModel.h"
#import "BBAPanelGridView.h"
#import "BBAPanelConfigModel.h"
@protocol BBAGridPanelViewDelegate <NSObject>
- (void)gridViewWillDisplayItemView:(UIView *)itemView
itemInGroup:(NSInteger)groupIndex
itemAtIndexPath:(NSIndexPath *)indexPath;
- (void)gridViewDidEndDisplayItemView:(UIView *)itemView
itemInGroup:(NSInteger)groupIndex
itemAtIndexPath:(NSIndexPath *)indexPath;
@end
@interface BBAPanelGroupedGridView : UIView
@property (nonatomic, copy) BBAPanelGridItemDidSelectCallBack itemDidSelected;
/// 网格布局面板的代理
@property (nonatomic, weak) id<BBAGridPanelViewDelegate> gridViewDelagate;
- (instancetype)initWithFrame:(CGRect)frame
groupModels:(NSArray <BBAPanelGridGroupModel *> *) groupModels
config:(BBAPanelConfigModel *)config;
/// 更新所有数据
- (void)reloadData;
/// 更新传入部分数据
- (void)reloadItems:(NSArray *)items;
/// 主动获取指定item视图
/// @return 返回指定位置的item的内容区域视图
/// @param groupIndex item所在的groupIndex
/// @param indexPath item的indexPath
- (UIView *)gridItemViewAtGroup:(NSInteger)groupIndex indexPath:(NSIndexPath *)indexPath;
@end