mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Revert "Use textStorageCreationBlock for resetting the text storage (#1874)"
This reverts commit d646d3c753.
This commit is contained in:
@@ -23,7 +23,6 @@
|
||||
NSTextContainer *_textContainer;
|
||||
|
||||
NSAttributedString *_attributedString;
|
||||
ASTextKitContextTextStorageCreationBlock _textStorageCreationBlock;
|
||||
}
|
||||
|
||||
#pragma mark - Lifecycle
|
||||
@@ -35,7 +34,7 @@
|
||||
constrainedSize:(CGSize)constrainedSize
|
||||
layoutManagerCreationBlock:(NSLayoutManager * (^)(void))layoutCreationBlock
|
||||
layoutManagerDelegate:(id<NSLayoutManagerDelegate>)layoutManagerDelegate
|
||||
textStorageCreationBlock:(ASTextKitContextTextStorageCreationBlock)textStorageCreationBlock
|
||||
textStorageCreationBlock:(NSTextStorage * (^)(NSAttributedString *attributedString))textStorageCreationBlock
|
||||
|
||||
{
|
||||
if (self = [super init]) {
|
||||
@@ -44,7 +43,6 @@
|
||||
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) {
|
||||
@@ -81,11 +79,7 @@
|
||||
|
||||
- (void)_resetTextStorage
|
||||
{
|
||||
if (_textStorageCreationBlock) {
|
||||
[_textStorage setAttributedString:_textStorageCreationBlock(_attributedString)];
|
||||
} else {
|
||||
[_textStorage setAttributedString:_attributedString];
|
||||
}
|
||||
[_textStorage setAttributedString:_attributedString];
|
||||
}
|
||||
|
||||
#pragma mark - Setter / Getter
|
||||
|
||||
Reference in New Issue
Block a user