Skip to content
This repository was archived by the owner on Sep 6, 2019. It is now read-only.

Commit 8059672

Browse files
committed
修复了点击RKOTextView的清除按钮之后不执行文字textViewDidChange方法的bug
1 parent 59d2a93 commit 8059672

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
自己平时写的一个小工具库,上传到GitHub中且支持CocoaPods,方便自己使用。不断更新完善中。
44

55
<p align="center">
6-
<a href=""><img src="https://img.shields.io/badge/pod-v1.3.2-brightgreen.svg"></a>
6+
<a href=""><img src="https://img.shields.io/badge/pod-v1.3.3-brightgreen.svg"></a>
77
<a href=""><img src="https://img.shields.io/badge/ObjectiveC-compatible-orange.svg"></a>
88
<a href=""><img src="https://img.shields.io/badge/platform-iOS%208.0%2B-ff69b5152950834.svg"></a>
99
<a href="https://github.com/rakuyoMo/RKOTools/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg?style=flat"></a>

RKOTools.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Pod::Spec.new do |s|
1010

1111
s.name = "RKOTools"
12-
s.version = "1.3.2"
12+
s.version = "1.3.3"
1313
s.summary = "One of your own tool libraries"
1414
s.description = <<-DESC
1515
One of your own tool libraries

RKOTools/RKOControl/RKOTextView/RKOTextView.m

+12
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder {
8585

8686
- (void)setUp {
8787

88+
89+
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc]init];
90+
paragraphStyle.lineBreakMode = NSLineBreakByCharWrapping;
91+
NSDictionary *attributes = @{NSParagraphStyleAttributeName:paragraphStyle};
92+
self.attributedText = [[NSAttributedString alloc]initWithString:self.text attributes:attributes];
93+
94+
8895
// 设置TextView默认字体大小。修改该大小可以一并修改占位符文字的大小。
8996
self.font = [UIFont systemFontOfSize:18];
9097
// 默认为白色背景
@@ -466,6 +473,11 @@ - (void)clearTextViewContent {
466473

467474
// 隐藏清除按钮,显示占位符,更新高度。
468475
[self judgmentSubviewsDisplayed:self];
476+
477+
// 提供代理,供用户监听输入
478+
if (self.textViewDelegate && [self.textViewDelegate respondsToSelector:@selector(textViewDidChange:)]) {
479+
[self.textViewDelegate textViewDidChange:self];
480+
}
469481
}
470482

471483
- (void)layoutClearButton {

0 commit comments

Comments
 (0)