JLChen
2021-11-04 d3713a9e02760ac9f5c0551ca72be0bdda3ba91c
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
//
//  Copyright © 2020 dahua. All rights reserved.
//
 
#import "LCDeviceSettingArrowCell.h"
#import "LCUIKit.h"
 
@interface LCDeviceSettingArrowCell ()
@property (weak, nonatomic) IBOutlet UILabel *titleLab;
@property (weak, nonatomic) IBOutlet LCButton *rightBtn;
@property (weak, nonatomic) IBOutlet UIImageView *deviceSnap;
@property (weak, nonatomic) IBOutlet UILabel *subtitleLab;
 
@end
 
@implementation LCDeviceSettingArrowCell
 
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapClick:)];
    [self addGestureRecognizer:tap];
}
 
-(void)tapClick:(UITapGestureRecognizer *)tap{
    if (self.block) {
        self.block(0);
    }
}
- (IBAction)rightBtnClick:(UIButton *)sender {
    if (self.block) {
        self.block(1);
    }
}
 
-(void)setTitle:(NSString *)title{
    _title = title;
    self.titleLab.text = title;
}
 
-(void)setSubtitle:(NSString *)subtitle{
    _subtitle = subtitle;
    self.subtitleLab.text = subtitle;
}
 
-(void)setArrowImage:(UIImage *)image{
    [self.rightBtn setImage:image forState:UIControlStateNormal];
}
 
- (void)loadImage:(NSString *)imageUrl DeviceId:(NSString *)deviceId ChannelId:(NSString *)channelId {
    [self.deviceSnap lc_setThumbImageWithURL:imageUrl placeholderImage:LC_IMAGENAMED(@"common_defaultcover_big") DeviceId:deviceId ChannelId:channelId];
}
 
 
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
 
    // Configure the view for the selected state
}
 
-(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event{
    if ([self.rightBtn pointInside:point withEvent:event]) {
        return self.rightBtn;
    }
    return [super hitTest:point withEvent:event];
}
 
@end