//
//  InsuredItemCell.m
//  Open
//
//  Created by 雷俊博 on 2019/12/20.
//  Copyright © 2019 黄江涛 . All rights reserved.
//

#import "InsuredItemCell.h"


@implementation InsuredItemCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle =  UITableViewCellSelectionStyleNone;
        [self.contentView addSubview:self.lb_title];
        [self.contentView addSubview:self.cuSwitch];
        [self.contentView addSubview:self.line];
        
    }
    return self;
}

#pragma mark - getters and setters
- (UILabel *)lb_title
{
    if (!_lb_title) {
        _lb_title = [[UILabel alloc]initWithFrame:CGRectMake(20, 0, 200, 45)];
        _lb_title.textColor = [UIColor colorWithHex:0x4d4d4d];
        _lb_title.font = [UIFont systemFontOfSize:15];
    }
    return _lb_title;
}

- (MySwitch *)cuSwitch
{
    if (!_cuSwitch) {
        _cuSwitch = [[MySwitch alloc]initWithFrame:CGRectMake(ScreenWidth- 20-52, 8, 52, 29) withGap:0];
        [_cuSwitch setBackgroundImage:[UIImage imageNamed:@"swith_whiteBg.png"]];
        [_cuSwitch setRightBlockImage:[UIImage imageNamed:@"swith_YES.png"]];
        [_cuSwitch setLeftBlockImage:[UIImage imageNamed:@"swith_No.png"]];
    }
    return _cuSwitch;
}

- (UIView *)line
{
    if (!_line) {
        _line = [[UIView alloc]initWithFrame:CGRectMake(10, 44.5, ScreenWidth - 20, 0.5)];
        _line.backgroundColor = [UIColor colorWithHex:0xcccccc alpha:0.5];
    }
    return _line;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
