Răsfoiți Sursa

add KVO support for property 'textLayout' of YYTextView

ibireme 9 ani în urmă
părinte
comite
6ce32792d5
1 a modificat fișierele cu 2 adăugiri și 1 ștergeri
  1. 2 1
      YYText/YYTextView.m

+ 2 - 1
YYText/YYTextView.m

@@ -254,8 +254,9 @@ typedef NS_ENUM(NSUInteger, YYTextMoveDirection) {
             [text yy_setAttribute:key value:value range:NSMakeRange(_innerText.length, 1)];
         }];
     }
-    
+    [self willChangeValueForKey:@"textLayout"];
     _innerLayout = [YYTextLayout layoutWithContainer:_innerContainer text:text];
+    [self didChangeValueForKey:@"textLayout"];
     CGSize size = [_innerLayout textBoundingSize];
     CGSize visibleSize = [self _getVisibleSize];
     if (_innerContainer.isVerticalForm) {