Update
One option would be disabling user interaction on the bottom view, and in the top view implementing:
func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent)
func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent)
func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent)
In these functions, you can check the type with touches.first?.type
, and you can check the view with touches.first?.view
, and if they satisfy your criteria you can call touchesBegan/Moved/Ended
on the bottom view.
What it said before:
Use these three methods:
func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent)
func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent)
func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent)
You can check they type with touches.first?.type, and you can check the view with touches.first?.view.
You could forward the touches by calling touchesBegan/Moved/Ended
on the view underneath.