// // HonorTableViewCell.m // model // // Created by liufei on 2018/7/25. // Copyright © 2018年 Mine. All rights reserved. // #import "HonorTableViewCell.h" #import "UITextView+WZB.h" @interface HonorTableViewCell () @end @implementation HonorTableViewCell - (void)awakeFromNib { [super awakeFromNib]; self.numberLabel.textColor = RGBValueColor(0xfe4086, 1); self.lineView.backgroundColor = RGBValueColor(0xdfdfdf, 1); self.honorTextView.wzb_placeholder = @"描述你过去获得的相关荣誉..."; self.honorTextView.delegate = self; // Initialization code } - (void)textViewDidChange:(UITextView *)textView { if (textView.text.length > 100) { textView.text = [textView.text substringToIndex:100]; } self.numberLabel.text = [NSString stringWithFormat:@"%ld",self.honorTextView.text.length]; } - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { if ([text isEqualToString:@""]) { return YES; } if (textView.text.length < 100) { return YES; } else { return NO; } } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } @end