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

Commit d83f319

Browse files
committed
Revert "Use textStorageCreationBlock for resetting the text storage (#1874)"
This reverts commit d646d3c.
1 parent ff7a586 commit d83f319

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

AsyncDisplayKit/TextKit/ASTextKitContext.mm

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ @implementation ASTextKitContext
2323
NSTextContainer *_textContainer;
2424

2525
NSAttributedString *_attributedString;
26-
ASTextKitContextTextStorageCreationBlock _textStorageCreationBlock;
2726
}
2827

2928
#pragma mark - Lifecycle
@@ -35,7 +34,7 @@ - (instancetype)initWithAttributedString:(NSAttributedString *)attributedString
3534
constrainedSize:(CGSize)constrainedSize
3635
layoutManagerCreationBlock:(NSLayoutManager * (^)(void))layoutCreationBlock
3736
layoutManagerDelegate:(id<NSLayoutManagerDelegate>)layoutManagerDelegate
38-
textStorageCreationBlock:(ASTextKitContextTextStorageCreationBlock)textStorageCreationBlock
37+
textStorageCreationBlock:(NSTextStorage * (^)(NSAttributedString *attributedString))textStorageCreationBlock
3938

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

4645
_attributedString = [attributedString copy];
47-
_textStorageCreationBlock = [textStorageCreationBlock copy];
4846

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

8280
- (void)_resetTextStorage
8381
{
84-
if (_textStorageCreationBlock) {
85-
[_textStorage setAttributedString:_textStorageCreationBlock(_attributedString)];
86-
} else {
87-
[_textStorage setAttributedString:_attributedString];
88-
}
82+
[_textStorage setAttributedString:_attributedString];
8983
}
9084

9185
#pragma mark - Setter / Getter

0 commit comments

Comments
 (0)