mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix passcode button input cancellation
This commit is contained in:
parent
cae9dcd54d
commit
8b1f004003
@ -147,16 +147,11 @@ final class PasscodeEntryButtonNode: HighlightTrackingButtonNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.addTarget(self, action: #selector(self.nop), forControlEvents: .touchUpInside)
|
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 nop() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc private func cancel() {
|
|
||||||
self.cancelAction?()
|
|
||||||
}
|
|
||||||
|
|
||||||
override var frame: CGRect {
|
override var frame: CGRect {
|
||||||
get {
|
get {
|
||||||
return super.frame
|
return super.frame
|
||||||
@ -209,6 +204,20 @@ final class PasscodeEntryButtonNode: HighlightTrackingButtonNode {
|
|||||||
|
|
||||||
self.action?()
|
self.action?()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
|
||||||
|
super.touchesEnded(touches, with: event)
|
||||||
|
|
||||||
|
if let touchPosition = touches.first?.location(in: self.view), !self.view.bounds.contains(touchPosition) {
|
||||||
|
self.cancelAction?()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override func touchesCancelled(_ touches: Set<UITouch>?, with event: UIEvent?) {
|
||||||
|
super.touchesCancelled(touches, with: event)
|
||||||
|
|
||||||
|
self.cancelAction?()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private let buttonsData = [
|
private let buttonsData = [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user