mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-03-01 14:20:58 +00:00
Add support for configuring on ASEditableTextNode.
This commit is contained in:
@@ -77,6 +77,7 @@
|
||||
_textKitComponents = [ASTextKitComponents componentsWithAttributedSeedString:nil textContainerSize:CGSizeZero];
|
||||
_textKitComponents.layoutManager.delegate = self;
|
||||
_wordKerner = [[ASTextNodeWordKerner alloc] init];
|
||||
_returnKeyType = UIReturnKeyDefault;
|
||||
|
||||
// Create the placeholder scaffolding.
|
||||
_placeholderTextKitComponents = [ASTextKitComponents componentsWithAttributedSeedString:nil textContainerSize:CGSizeZero];
|
||||
@@ -138,6 +139,7 @@
|
||||
_textKitComponents.textView.delegate = self;
|
||||
_textKitComponents.textView.editable = YES;
|
||||
_textKitComponents.textView.typingAttributes = _typingAttributes;
|
||||
_textKitComponents.textView.returnKeyType = _returnKeyType;
|
||||
_textKitComponents.textView.accessibilityHint = _placeholderTextKitComponents.textStorage.string;
|
||||
configureTextView(_textKitComponents.textView);
|
||||
[self.view addSubview:_textKitComponents.textView];
|
||||
@@ -346,6 +348,13 @@
|
||||
return [_textKitComponents.textView textInputMode];
|
||||
}
|
||||
|
||||
- (void)setReturnKeyType:(UIReturnKeyType)returnKeyType
|
||||
{
|
||||
ASDN::MutexLocker l(_textKitLock);
|
||||
_returnKeyType = returnKeyType;
|
||||
[_textKitComponents.textView setReturnKeyType:_returnKeyType];
|
||||
}
|
||||
|
||||
- (BOOL)isFirstResponder
|
||||
{
|
||||
ASDN::MutexLocker l(_textKitLock);
|
||||
|
||||
Reference in New Issue
Block a user