DSBaseViewController.m
1.9 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
//
// DSBaseViewController.m
// DreamSleep
//
// Created by peter on 2022/5/6.
//
#import "DSBaseViewController.h"
@interface DSBaseViewController ()
@end
@implementation DSBaseViewController
- (void)viewDidLoad {
[super viewDidLoad];
}
- (void)backAction {
}
#pragma mark - lazy
- (UIView *)dsNaviBar {
if (!_dsNaviBar) {
_dsNaviBar = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kTopHeight(0))];
_dsNaviBar.alpha = 0;
_dsNaviBar.backgroundColor = BrandColor;
[_dsNaviBar addSubview:self.titleLab];
[_dsNaviBar addSubview:self.cusBackBtn];
[_titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.dsNaviBar);
make.bottom.equalTo(self.dsNaviBar).offset(-9);
}];
}
return _dsNaviBar;
}
- (UILabel *)titleLab {
if (!_titleLab) {
_titleLab = [UILabel labWithTextColor:DSWhite font:BoldFont(18)];
_titleLab.textAlignment = NSTextAlignmentCenter;
_titleLab.hidden = YES;
}
return _titleLab;
}
- (UIButton *)cusBackBtn {
if (!_cusBackBtn) {
_cusBackBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, kStatusBarHeight, 40, 40)];
[_cusBackBtn setImage:[UIImage imageNamed:@"sys_back_icon"] forState:UIControlStateNormal];
[_cusBackBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
}
return _cusBackBtn;
}
- (UIButton *)dkBackBtn {
if (!_dkBackBtn) {
_dkBackBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, kStatusBarHeight, 40, 40)];
[_dkBackBtn dk_setImage:DKImagePickerWithNames(@"cus_back_icon", @"dk_cus_back_icon", @"dk_cus_back_icon") forState:UIControlStateNormal];
[_dkBackBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
}
return _dkBackBtn;
}
@end