mirror of
https://github.com/GLEGram/GLEGram-iOS.git
synced 2026-04-25 04:16:58 +02:00
4647310322
Based on Swiftgram 12.5 (Telegram iOS 12.5). All GLEGram features ported and organized in GLEGram/ folder. Features: Ghost Mode, Saved Deleted Messages, Content Protection Bypass, Font Replacement, Fake Profile, Chat Export, Plugin System, and more. See CHANGELOG_12.5.md for full details.
38 lines
1020 B
Swift
38 lines
1020 B
Swift
import Foundation
|
|
import UIKit
|
|
import AsyncDisplayKit
|
|
|
|
private final class ViewControllerTracingNodeView: UITracingLayerView {
|
|
private var inHitTest = false
|
|
var hitTestImpl: ((CGPoint, UIEvent?) -> UIView?)?
|
|
|
|
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
|
|
if self.inHitTest {
|
|
return super.hitTest(point, with: event)
|
|
} else {
|
|
self.inHitTest = true
|
|
let result = self.hitTestImpl?(point, event)
|
|
self.inHitTest = false
|
|
return result
|
|
}
|
|
}
|
|
}
|
|
|
|
open class ViewControllerTracingNode: ASDisplayNode {
|
|
override public init() {
|
|
super.init()
|
|
|
|
self.setViewBlock({
|
|
return ViewControllerTracingNodeView()
|
|
})
|
|
}
|
|
|
|
override open func didLoad() {
|
|
super.didLoad()
|
|
|
|
(self.view as! ViewControllerTracingNodeView).hitTestImpl = { [weak self] point, event in
|
|
return self?.hitTest(point, with: event)
|
|
}
|
|
}
|
|
}
|