mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Various Improvements
This commit is contained in:
@@ -22,6 +22,7 @@ public final class PeekControllerGestureRecognizer: UIPanGestureRecognizer {
|
||||
private let present: (PeekControllerContent, ASDisplayNode) -> ViewController?
|
||||
private let updateContent: (PeekControllerContent?) -> Void
|
||||
private let activateBySingleTap: Bool
|
||||
public var checkSingleTapActivationAtPoint: ((CGPoint) -> Bool)?
|
||||
|
||||
private var tapLocation: CGPoint?
|
||||
private var longTapTimer: SwiftSignalKit.Timer?
|
||||
@@ -129,7 +130,12 @@ public final class PeekControllerGestureRecognizer: UIPanGestureRecognizer {
|
||||
override public func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent) {
|
||||
super.touchesEnded(touches, with: event)
|
||||
|
||||
if self.activateBySingleTap, self.presentedController == nil {
|
||||
var activateBySingleTap = self.activateBySingleTap
|
||||
if !activateBySingleTap, let checkSingleTapActivationAtPoint = self.checkSingleTapActivationAtPoint, let tapLocation = self.tapLocation {
|
||||
activateBySingleTap = checkSingleTapActivationAtPoint(tapLocation)
|
||||
}
|
||||
|
||||
if activateBySingleTap, self.presentedController == nil {
|
||||
self.longTapTimer?.invalidate()
|
||||
self.pressTimer?.invalidate()
|
||||
if let tapLocation = self.tapLocation {
|
||||
|
||||
Reference in New Issue
Block a user