HonorTableViewCell.m 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // HonorTableViewCell.m
  3. // model
  4. //
  5. // Created by liufei on 2018/7/25.
  6. // Copyright © 2018年 Mine. All rights reserved.
  7. //
  8. #import "HonorTableViewCell.h"
  9. #import "UITextView+WZB.h"
  10. @interface HonorTableViewCell ()<UITextViewDelegate>
  11. @end
  12. @implementation HonorTableViewCell
  13. - (void)awakeFromNib {
  14. [super awakeFromNib];
  15. self.numberLabel.textColor = RGBValueColor(0xfe4086, 1);
  16. self.lineView.backgroundColor = RGBValueColor(0xdfdfdf, 1);
  17. self.honorTextView.wzb_placeholder = @"描述你过去获得的相关荣誉...";
  18. self.honorTextView.delegate = self;
  19. // Initialization code
  20. }
  21. - (void)textViewDidChange:(UITextView *)textView {
  22. if (textView.text.length > 100) {
  23. textView.text = [textView.text substringToIndex:100];
  24. }
  25. self.numberLabel.text = [NSString stringWithFormat:@"%ld",self.honorTextView.text.length];
  26. }
  27. - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
  28. if ([text isEqualToString:@""]) {
  29. return YES;
  30. }
  31. if (textView.text.length < 100) {
  32. return YES;
  33. } else {
  34. return NO;
  35. }
  36. }
  37. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  38. [super setSelected:selected animated:animated];
  39. // Configure the view for the selected state
  40. }
  41. @end