DSBaseViewController.m 1.9 KB
//
//  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