forked from bestswifter/MySampleCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKtBaseTableView.h
More file actions
51 lines (33 loc) · 1.29 KB
/
KtBaseTableView.h
File metadata and controls
51 lines (33 loc) · 1.29 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
//
// KtBaseTableView.h
// KtTableView
//
// Created by baidu on 16/4/13.
// Copyright © 2016年 zxy. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "KtTableViewDataSource.h"
@class KtTableViewSectionObject;
@protocol KtTableViewDelegate<UITableViewDelegate>
@optional
/**
* 选择一个cell的回调,并返回被选择cell的数据结构和indexPath
*/
- (void)didSelectObject:(id)object atIndexPath:(NSIndexPath*)indexPath;
- (UIView *)headerViewForSectionObject:(KtTableViewSectionObject *)sectionObject atSection:(NSInteger)section;
// 下拉刷新触发的方法
- (void)pullDownToRefreshAction;
// 上拉加载触发的方法
- (void)pullUpToRefreshAction;
// 将来可以有 cell 的编辑,交换,左滑等回调
// 这个协议继承了UITableViewDelegate ,所以自己做一层中转,VC 依然需要实现某些代理方法。
@end
@interface KtBaseTableView : UITableView<UITableViewDelegate>
@property (nonatomic, assign) id<KtTableViewDataSource> ktDataSource;
@property (nonatomic, assign) id<KtTableViewDelegate> ktDelegate;
// 是否需要下拉刷新和上拉加载
@property (nonatomic, assign) BOOL isNeedPullDownToRefreshAction;
@property (nonatomic, assign) BOOL isNeedPullUpToRefreshAction;
- (void)stopRefreshingAnimation;
- (void)triggerRefreshing;
@end