Skip to content

Commit 6ce3279

Browse files
committed
add KVO support for property 'textLayout' of YYTextView
1 parent 3d31ec5 commit 6ce3279

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

YYText/YYTextView.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,9 @@ - (void)_updateLayout {
254254
[text yy_setAttribute:key value:value range:NSMakeRange(_innerText.length, 1)];
255255
}];
256256
}
257-
257+
[self willChangeValueForKey:@"textLayout"];
258258
_innerLayout = [YYTextLayout layoutWithContainer:_innerContainer text:text];
259+
[self didChangeValueForKey:@"textLayout"];
259260
CGSize size = [_innerLayout textBoundingSize];
260261
CGSize visibleSize = [self _getVisibleSize];
261262
if (_innerContainer.isVerticalForm) {

0 commit comments

Comments
 (0)