mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Add an ASEditableTextNode initializer that allows customization of its ASTextKitComponents
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
|
||||
#import "ASDisplayNode+Subclasses.h"
|
||||
#import "ASEqualityHelpers.h"
|
||||
#import "ASTextKitHelpers.h"
|
||||
#import "ASTextNodeWordKerner.h"
|
||||
#import "ASThread.h"
|
||||
|
||||
@@ -93,6 +92,13 @@
|
||||
|
||||
#pragma mark - NSObject Overrides
|
||||
- (instancetype)init
|
||||
{
|
||||
return [self initWithTextKitComponents:[ASTextKitComponents componentsWithAttributedSeedString:nil textContainerSize:CGSizeZero]
|
||||
placeholderTextKitComponents:[ASTextKitComponents componentsWithAttributedSeedString:nil textContainerSize:CGSizeZero]];
|
||||
}
|
||||
|
||||
- (instancetype)initWithTextKitComponents:(ASTextKitComponents *)textKitComponents
|
||||
placeholderTextKitComponents:(ASTextKitComponents *)placeholderTextKitComponents
|
||||
{
|
||||
if (!(self = [super init]))
|
||||
return nil;
|
||||
@@ -101,14 +107,14 @@
|
||||
_scrollEnabled = YES;
|
||||
|
||||
// Create the scaffolding for the text view.
|
||||
_textKitComponents = [ASTextKitComponents componentsWithAttributedSeedString:nil textContainerSize:CGSizeZero];
|
||||
_textKitComponents = textKitComponents;
|
||||
_textKitComponents.layoutManager.delegate = self;
|
||||
_wordKerner = [[ASTextNodeWordKerner alloc] init];
|
||||
_returnKeyType = UIReturnKeyDefault;
|
||||
_textContainerInset = UIEdgeInsetsZero;
|
||||
|
||||
// Create the placeholder scaffolding.
|
||||
_placeholderTextKitComponents = [ASTextKitComponents componentsWithAttributedSeedString:nil textContainerSize:CGSizeZero];
|
||||
_placeholderTextKitComponents = placeholderTextKitComponents;
|
||||
_placeholderTextKitComponents.layoutManager.delegate = self;
|
||||
|
||||
return self;
|
||||
|
||||
Reference in New Issue
Block a user