mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Various Fixes
This commit is contained in:
@@ -113,6 +113,7 @@ final class PasscodeEntryButtonNode: HighlightTrackingButtonNode {
|
||||
private let backgroundNode: ASImageNode
|
||||
|
||||
var action: (() -> Void)?
|
||||
var cancelAction: (() -> Void)?
|
||||
|
||||
init(presentationData: PresentationData, background: PasscodeBackground, title: String, subtitle: String) {
|
||||
self.presentationData = presentationData
|
||||
@@ -146,11 +147,16 @@ final class PasscodeEntryButtonNode: HighlightTrackingButtonNode {
|
||||
}
|
||||
|
||||
self.addTarget(self, action: #selector(self.nop), forControlEvents: .touchUpInside)
|
||||
self.addTarget(self, action: #selector(self.cancel), forControlEvents: .touchUpOutside)
|
||||
}
|
||||
|
||||
@objc private func nop() {
|
||||
}
|
||||
|
||||
@objc private func cancel() {
|
||||
self.cancelAction?()
|
||||
}
|
||||
|
||||
override var frame: CGRect {
|
||||
get {
|
||||
return super.frame
|
||||
@@ -223,6 +229,7 @@ final class PasscodeEntryKeyboardNode: ASDisplayNode {
|
||||
private var background: PasscodeBackground?
|
||||
|
||||
var charactedEntered: ((String) -> Void)?
|
||||
var backspace: (() -> Void)?
|
||||
|
||||
private func updateButtons() {
|
||||
guard let presentationData = self.presentationData, let background = self.background else {
|
||||
@@ -239,6 +246,9 @@ final class PasscodeEntryKeyboardNode: ASDisplayNode {
|
||||
buttonNode.action = { [weak self] in
|
||||
self?.charactedEntered?(title)
|
||||
}
|
||||
buttonNode.cancelAction = { [weak self] in
|
||||
self?.backspace?()
|
||||
}
|
||||
self.addSubnode(buttonNode)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user