Various improvements

This commit is contained in:
Ilya Laktyushin
2022-05-20 23:11:45 +04:00
parent 10326f1fac
commit 4b41660767
53 changed files with 1357 additions and 522 deletions

View File

@@ -132,6 +132,7 @@ final class WebAppWebView: WKWebView {
self.sendEvent(name: "viewport_changed", data: data)
}
var lastTouchTimestamp: Double?
private(set) var didTouchOnce = false
var onFirstTouch: () -> Void = {}
@@ -161,6 +162,7 @@ final class WebAppWebView: WKWebView {
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
let result = super.hitTest(point, with: event)
self.lastTouchTimestamp = CACurrentMediaTime()
if result != nil && !self.didTouchOnce {
self.didTouchOnce = true
self.onFirstTouch()