mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Various improvements
This commit is contained in:
@@ -19,6 +19,8 @@ public protocol ChatInputTextNodeDelegate: AnyObject {
|
||||
func chatInputTextNode(shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool
|
||||
func chatInputTextNodeShouldCopy() -> Bool
|
||||
func chatInputTextNodeShouldPaste() -> Bool
|
||||
|
||||
func chatInputTextNodeShouldRespondToAction(action: Selector) -> Bool
|
||||
}
|
||||
|
||||
open class ChatInputTextNode: ASDisplayNode, UITextViewDelegate {
|
||||
@@ -125,6 +127,16 @@ open class ChatInputTextNode: ASDisplayNode, UITextViewDelegate {
|
||||
})
|
||||
|
||||
self.textView.delegate = self
|
||||
self.textView.shouldRespondToAction = { [weak self] action in
|
||||
guard let self, let action else {
|
||||
return false
|
||||
}
|
||||
if let delegate = self.delegate {
|
||||
return delegate.chatInputTextNodeShouldRespondToAction(action: action)
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public func resetInitialPrimaryLanguage() {
|
||||
|
||||
Reference in New Issue
Block a user