CNMessageNotesController.m
2.99 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//
// CNMessageNotesController.m
// CNLiveCMineModule
//
// Created by iOS on 2022/12/7.
//
#import "CNMessageNotesController.h"
#import "CNMessgeNoteCell.h"
#import "CNCSubMinePresent.h"
static NSString const*kCNMessgeNoteCellID = @"CNMessgeNoteCellID";
@interface CNMessageNotesController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong)CNLiveNavigationBar *navigationBar;
@property (nonatomic, strong)UITableView *tableView;
@property (nonatomic, strong)NSArray *dataSource;
@end
@implementation CNMessageNotesController
- (void)dealloc{
NSLog(@"%s",__func__);
}
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = UIColorWhite;
self.dataSource = [CNCSubMinePresent getMessageNotificationList];
[self.view addSubview:self.navigationBar];
[self.view addSubview:self.tableView];
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.equalTo(self.view);
make.top.equalTo(self.navigationBar.mas_bottom);
}];
}
- (BOOL)preferredNavigationBarHidden{
return YES;
}
#pragma mark - UITableViewDelegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
{
return 59;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
return 50;
}
- (nullable UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(18, 10, kScreenWidth - 36, 40)];
label.font = UIFontMake(14);
label.textColor = UIColorHex(#999999);
label.numberOfLines = 2;
label.text = @"关闭后你将不会在下拉通知看到该类型的消息,但在网家家内会显示红点。";
return label;
}
#pragma mark - UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return self.dataSource.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
CNMessgeNoteCell *cell = [tableView dequeueReusableCellWithIdentifier:kCNMessgeNoteCellID];
return cell;
}
#pragma mark - Getting
- (CNLiveNavigationBar *)navigationBar{
if (!_navigationBar) {
_navigationBar = [CNLiveNavigationBar navigationBar];
_navigationBar.title.text = @"消息通知";
weakself
_navigationBar.onClickLeftButton = ^{
[weakSelf.navigationController popViewControllerAnimated:YES];
};
}
return _navigationBar;
}
- (UITableView *)tableView{
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
_tableView.backgroundColor = UIColorHex(#F2F2F2);
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_tableView.delegate = self;
_tableView.dataSource = self;
[_tableView registerClass:[CNMessgeNoteCell class] forCellReuseIdentifier:kCNMessgeNoteCellID];
}
return _tableView;
}
@end