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.
相关问题
- Stop child process when parent process stops
- Fire resize event once not based on timing
- Unable to change UISearchBar cancel button title c
- C# CS0079 Event Handling Compile Errors
- Google Maps event listeners not working properly i
相关文章
- What does it means in C# : using -= operator by ev
- How are custom broadcast events implemented in Jav
- Programming a touch screen application with SWING
- How many pixels are scrolled on a website with a m
- Difference Between RoutedEventHandler and EventHan
- Why are my UIView layer properties not being set w
- Wait for function till user stops typing
- WPF- validation error event doesn't fire
For passing touches from an overlay view to the views underneath, implement the following method in the UIView:
Objective-C:
Swift:
was all I needed!
If the view you want to forward the touches to doesn't happen to be a subview / superview, you can set up a custom property in your UIView subclass like so:
Make sure to synthesize it in your .m:
And then include the following in any of your UIResponder methods such as:
Wherever you instantiate your UIView, set the forwardableTouchee property to whatever view you'd like the events to be forwarded to: