@@ -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