hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView?

禁止蒙板以下的其他控制器响应事件.



override public func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {

let view = super.hitTest(point, with: event)

if backView.frame.contains(point) {

return view

}else {

return self

}

}

你可能感兴趣的:(hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView?)