Various Fixes

This commit is contained in:
Ilya Laktyushin
2021-07-09 02:21:24 +03:00
parent f80b2641c3
commit 3ac8fddce5
6 changed files with 3299 additions and 3269 deletions

View File

@@ -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)
}
}