mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-11 17:00:02 +00:00
Additional fixes for global 3d touch workaround
This commit is contained in:
parent
481f0437b4
commit
d3f62da375
@ -20,11 +20,9 @@ private func tracePreviewingHostView(view: UIView, point: CGPoint) -> (UIView &
|
|||||||
if let view = view as? UIView & PreviewingHostView {
|
if let view = view as? UIView & PreviewingHostView {
|
||||||
return (view, point)
|
return (view, point)
|
||||||
}
|
}
|
||||||
for subview in view.subviews {
|
if let superview = view.superview {
|
||||||
if subview.frame.contains(point) && !subview.isHidden && subview.isUserInteractionEnabled {
|
if let result = tracePreviewingHostView(view: superview, point: superview.convert(point, from: view)) {
|
||||||
if let result = tracePreviewingHostView(view: subview, point: view.convert(point, to: subview)) {
|
return result
|
||||||
return result
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@ -133,7 +131,10 @@ private final class WindowRootViewController: UIViewController, UIViewController
|
|||||||
|
|
||||||
public func previewingContext(_ previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? {
|
public func previewingContext(_ previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? {
|
||||||
if #available(iOSApplicationExtension 9.0, *) {
|
if #available(iOSApplicationExtension 9.0, *) {
|
||||||
if let (result, resultPoint) = tracePreviewingHostView(view: self.view, point: location), let delegate = result.previewingDelegate {
|
guard let result = self.view.hitTest(location, with: nil) else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if let (result, resultPoint) = tracePreviewingHostView(view: result, point: self.view.convert(location, to: result)), let delegate = result.previewingDelegate {
|
||||||
self.previousPreviewingHostView = result
|
self.previousPreviewingHostView = result
|
||||||
return delegate.previewingContext(previewingContext, viewControllerForLocation: resultPoint)
|
return delegate.previewingContext(previewingContext, viewControllerForLocation: resultPoint)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user