Skip to content

Commit

Permalink
* [ios] try to fix textStorage thread-safe issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cxfeng1 committed Sep 1, 2016
1 parent a938b08 commit 0d62716
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ - (instancetype)initWithFrame:(CGRect)frame

self.opaque = NO;
self.contentMode = UIViewContentModeRedraw;
self.textStorage = [NSTextStorage new];
}
return self;
}
Expand Down Expand Up @@ -66,6 +67,14 @@ - (UIImage *)drawTextWithBounds:(CGRect)bounds padding:(UIEdgeInsets)padding
return image;
}

- (void)setTextStorage:(NSTextStorage *)textStorage
{
if (_textStorage != textStorage) {
_textStorage = textStorage;
[self setNeedsDisplay];
}
}

- (NSString *)description
{
NSString *superDescription = super.description;
Expand Down

0 comments on commit 0d62716

Please sign in to comment.