iOS - forward all touches through a view

sol picture sol · Sep 30, 2010 · Viewed 75.5k times · Source

I have a view overlayed on top of many other views. I am only using the overaly to detect some number of touches on the screen, but other than that I don't want the view to stop the behavior of other views underneath, which are scrollviews, etc. How can I forward all the touches through this overlay view? It is a subcalss of UIView.

Answer

rmp251 picture rmp251 · Aug 26, 2013

Disabling user interaction was all I needed!

Objective-C:

myWebView.userInteractionEnabled = NO;

Swift:

myWebView.isUserInteractionEnabled = false