mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +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;
|
NSTextContainer *_textContainer;
|
||||||
|
|
||||||
NSAttributedString *_attributedString;
|
NSAttributedString *_attributedString;
|
||||||
ASTextKitContextTextStorageCreationBlock _textStorageCreationBlock;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Lifecycle
|
#pragma mark - Lifecycle
|
||||||
@@ -35,7 +34,7 @@
|
|||||||
constrainedSize:(CGSize)constrainedSize
|
constrainedSize:(CGSize)constrainedSize
|
||||||
layoutManagerCreationBlock:(NSLayoutManager * (^)(void))layoutCreationBlock
|
layoutManagerCreationBlock:(NSLayoutManager * (^)(void))layoutCreationBlock
|
||||||
layoutManagerDelegate:(id<NSLayoutManagerDelegate>)layoutManagerDelegate
|
layoutManagerDelegate:(id<NSLayoutManagerDelegate>)layoutManagerDelegate
|
||||||
textStorageCreationBlock:(ASTextKitContextTextStorageCreationBlock)textStorageCreationBlock
|
textStorageCreationBlock:(NSTextStorage * (^)(NSAttributedString *attributedString))textStorageCreationBlock
|
||||||
|
|
||||||
{
|
{
|
||||||
if (self = [super init]) {
|
if (self = [super init]) {
|
||||||
@@ -44,7 +43,6 @@
|
|||||||
std::lock_guard<std::mutex> l(__static_mutex);
|
std::lock_guard<std::mutex> l(__static_mutex);
|
||||||
|
|
||||||
_attributedString = [attributedString copy];
|
_attributedString = [attributedString copy];
|
||||||
_textStorageCreationBlock = [textStorageCreationBlock copy];
|
|
||||||
|
|
||||||
// Create the TextKit component stack with our default configuration.
|
// Create the TextKit component stack with our default configuration.
|
||||||
if (textStorageCreationBlock) {
|
if (textStorageCreationBlock) {
|
||||||
@@ -81,12 +79,8 @@
|
|||||||
|
|
||||||
- (void)_resetTextStorage
|
- (void)_resetTextStorage
|
||||||
{
|
{
|
||||||
if (_textStorageCreationBlock) {
|
|
||||||
[_textStorage setAttributedString:_textStorageCreationBlock(_attributedString)];
|
|
||||||
} else {
|
|
||||||
[_textStorage setAttributedString:_attributedString];
|
[_textStorage setAttributedString:_attributedString];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#pragma mark - Setter / Getter
|
#pragma mark - Setter / Getter
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user