Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Revert "Use textStorageCreationBlock for resetting the text storage (#…
Browse files Browse the repository at this point in the history
…1874)"

This reverts commit d646d3c.
  • Loading branch information
appleguy committed Jul 10, 2016
1 parent ff7a586 commit d83f319
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions AsyncDisplayKit/TextKit/ASTextKitContext.mm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ @implementation ASTextKitContext
NSTextContainer *_textContainer;

NSAttributedString *_attributedString;
ASTextKitContextTextStorageCreationBlock _textStorageCreationBlock;
}

#pragma mark - Lifecycle
Expand All @@ -35,7 +34,7 @@ - (instancetype)initWithAttributedString:(NSAttributedString *)attributedString
constrainedSize:(CGSize)constrainedSize
layoutManagerCreationBlock:(NSLayoutManager * (^)(void))layoutCreationBlock
layoutManagerDelegate:(id<NSLayoutManagerDelegate>)layoutManagerDelegate
textStorageCreationBlock:(ASTextKitContextTextStorageCreationBlock)textStorageCreationBlock
textStorageCreationBlock:(NSTextStorage * (^)(NSAttributedString *attributedString))textStorageCreationBlock

{
if (self = [super init]) {
Expand All @@ -44,7 +43,6 @@ - (instancetype)initWithAttributedString:(NSAttributedString *)attributedString
std::lock_guard<std::mutex> l(__static_mutex);

_attributedString = [attributedString copy];
_textStorageCreationBlock = [textStorageCreationBlock copy];

// Create the TextKit component stack with our default configuration.
if (textStorageCreationBlock) {
Expand Down Expand Up @@ -81,11 +79,7 @@ - (void)resetTextStorage

- (void)_resetTextStorage
{
if (_textStorageCreationBlock) {
[_textStorage setAttributedString:_textStorageCreationBlock(_attributedString)];
} else {
[_textStorage setAttributedString:_attributedString];
}
[_textStorage setAttributedString:_attributedString];
}

#pragma mark - Setter / Getter
Expand Down

0 comments on commit d83f319

Please sign in to comment.