65 lines
1.5 KiB
Objective-C
65 lines
1.5 KiB
Objective-C
//
|
|
// GiGaFeedContentViewCell.m
|
|
// GIGA
|
|
//
|
|
// Created by lianxiang on 2018/9/22.
|
|
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
|
//
|
|
|
|
#import "GiGaFeedContentViewCell.h"
|
|
|
|
@implementation GiGaFeedContentViewCell
|
|
|
|
- (void)awakeFromNib {
|
|
[super awakeFromNib];
|
|
// Initialization code
|
|
self.contentFiled.delegate =self;
|
|
}
|
|
|
|
- (void)textViewDidBeginEditing:(UITextView *)textView{
|
|
if (textView == self.contentFiled) {
|
|
self.holdLabe.hidden = YES;
|
|
}
|
|
|
|
}
|
|
- (void)textViewDidChange:(UITextView *)textView
|
|
{
|
|
if (textView == self.contentFiled) {
|
|
|
|
|
|
if ( textView.text.length <=100) {
|
|
if (textView.text.length == 0) {
|
|
self.holdLabe.hidden = NO;
|
|
}else{
|
|
self.holdLabe.hidden = YES;
|
|
}
|
|
|
|
self.numberCountLabe.text = [NSString stringWithFormat:@"%lu/100",(unsigned long)textView.text.length];
|
|
self.contentFiled.text = textView.text;
|
|
self.textMAx = textView.text;
|
|
}else{
|
|
textView.text = self.textMAx;
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{
|
|
|
|
|
|
// if ( textView.text.length >100 ) {
|
|
//
|
|
// return NO;
|
|
// }
|
|
return YES;
|
|
}
|
|
|
|
|
|
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
|
[super setSelected:selected animated:animated];
|
|
|
|
// Configure the view for the selected state
|
|
}
|
|
|
|
@end
|