I reconsidered the author part because it's better to make the ownership obvious to get rid of problems according to the unclearness.
18 lines
562 B
Swift
18 lines
562 B
Swift
// Copyright 2018-Present Shin Yamamoto. All rights reserved. MIT license.
|
|
|
|
import UIKit
|
|
|
|
@objc(FloatingPanelPassThroughView)
|
|
class PassThroughView: UIView {
|
|
public weak var eventForwardingView: UIView?
|
|
public override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
|
|
let hitView = super.hitTest(point, with: event)
|
|
switch hitView {
|
|
case self:
|
|
return eventForwardingView?.hitTest(self.convert(point, to: eventForwardingView), with: event)
|
|
default:
|
|
return hitView
|
|
}
|
|
}
|
|
}
|