// // RAEditMultInputCell.m // Apex And Drivers // // Created by Jack on 2018/6/4. // Copyright © 2018年 USAI. All rights reserved. // #import "RAEditMultInputCell.h" #import "RAEditMultInputModel.h" @interface RAEditMultInputCell () @property (strong, nonatomic) IBOutlet UILabel *titleLabel; @property (strong, nonatomic) IBOutlet UITextView *inputView; @end @implementation RAEditMultInputCell - (void)awakeFromNib { [super awakeFromNib]; // Initialization code self.model = nil; self.inputView.layer.borderWidth = 0.5f; self.inputView.layer.borderColor = [UIColor lightGrayColor].CGColor; } - (void)prepareForReuse { [super prepareForReuse]; self.model = nil; self.delegate = nil; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } - (void)setModel:(RAEditMultInputModel *)model { _model = model; self.titleLabel.text = _model.title; self.inputView.text = _model.value; } #pragma mark - TextView Delegate - (BOOL)textViewShouldBeginEditing:(UITextView *)textView { if (self.delegate && [self.delegate respondsToSelector:@selector(beginEditMultInputCell:)]) { [self.delegate beginEditMultInputCell:self]; } return YES; } - (BOOL)textViewShouldEndEditing:(UITextView *)textView { if (self.delegate && [self.delegate respondsToSelector:@selector(endEditMultInputCell:)]) { [self.delegate endEditMultInputCell:self]; } return YES; } @end