How can I make touch events pass through a UIView (similar to pointer-events:none in CSS)?

aleclarson

In CSS, pointer-events:none; allows click events to pass through an element. I'm curious if there is anything similar that I can do in Objective-C on iOS for UIViews.

Here's a jsfiddle to an example of pointer-events: none.

Could I somehow achieve the same behavior for a UIView by overriding hitTest:withEvent:? Or maybe there is another way to do this?

Thanks for any help.

dezinezync

What you're looking for is commonly called "Event Bubbling".

You may refer to the Apple docs here: https://developer.apple.com/documentation/uikit/understanding_event_handling_responders_and_the_responder_chain

So your basic instinct was right, you in fact do need utilize hitTest:withEvent:, but you can further customize things by hooking up into the Responder chain. That section has a very neat example.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to pass clicks and touch events through a region in a UIView?

From Dev

Touch through an element in a browser (like pointer-events: none)

From Dev

How can I pass ONLY clicks through a SVG with pointer-events?

From Dev

How to eliminate pointer events, but not touch events?

From Dev

How and can I disable touch events in Javascript?

From Dev

How do I allow JS onclick with pointer-events:none;?

From Java

Is there a `pointer-events:hoverOnly` or similar in CSS?

From Dev

Allow pointer events to pass through a nested div

From Dev

How to pass events through a JFrame?

From Dev

How to prevent UIView passing touch events to UIView's superview?

From Dev

How can I get events to my (sub) UIView?

From Dev

Capturing and recording touch events on UIView

From Java

Add CSS cursor property when using "pointer-events: none"

From Dev

Meteor - How can I pass data between helpers and events for a template?

From Dev

How do I Emulate touch events without using touch screen

From Dev

How to disable google maps touch events through a layout? (android)

From Dev

UIView alpha 0 but still receive touch events?

From Dev

duplicate/mirror touch events from uiview to uiscrollview

From Dev

Can touch events be forwarded to an MKMapView?

From Dev

How can I reliably simulate touch events on Android without root (like Automate and Tasker)?

From Dev

How do make a clipped views recieve touch events in iOS?

From Dev

How to Make Touch Events Affect View's Behind a Container View?

From Dev

How to make sure touch events are enabled in Firefox desktop browser?

From Dev

How to tween text up and down, and make it react to touch events

From Dev

How do make a clipped views recieve touch events in iOS?

From Dev

I can't seem to recognize touch events on android

From Dev

Trying to implement pointer-events: none in JavaScript

From Dev

Trying to implement pointer-events: none in JavaScript

From Dev

How can I make a similar shape to a parallelogram in css?

Related Related

  1. 1

    How to pass clicks and touch events through a region in a UIView?

  2. 2

    Touch through an element in a browser (like pointer-events: none)

  3. 3

    How can I pass ONLY clicks through a SVG with pointer-events?

  4. 4

    How to eliminate pointer events, but not touch events?

  5. 5

    How and can I disable touch events in Javascript?

  6. 6

    How do I allow JS onclick with pointer-events:none;?

  7. 7

    Is there a `pointer-events:hoverOnly` or similar in CSS?

  8. 8

    Allow pointer events to pass through a nested div

  9. 9

    How to pass events through a JFrame?

  10. 10

    How to prevent UIView passing touch events to UIView's superview?

  11. 11

    How can I get events to my (sub) UIView?

  12. 12

    Capturing and recording touch events on UIView

  13. 13

    Add CSS cursor property when using "pointer-events: none"

  14. 14

    Meteor - How can I pass data between helpers and events for a template?

  15. 15

    How do I Emulate touch events without using touch screen

  16. 16

    How to disable google maps touch events through a layout? (android)

  17. 17

    UIView alpha 0 but still receive touch events?

  18. 18

    duplicate/mirror touch events from uiview to uiscrollview

  19. 19

    Can touch events be forwarded to an MKMapView?

  20. 20

    How can I reliably simulate touch events on Android without root (like Automate and Tasker)?

  21. 21

    How do make a clipped views recieve touch events in iOS?

  22. 22

    How to Make Touch Events Affect View's Behind a Container View?

  23. 23

    How to make sure touch events are enabled in Firefox desktop browser?

  24. 24

    How to tween text up and down, and make it react to touch events

  25. 25

    How do make a clipped views recieve touch events in iOS?

  26. 26

    I can't seem to recognize touch events on android

  27. 27

    Trying to implement pointer-events: none in JavaScript

  28. 28

    Trying to implement pointer-events: none in JavaScript

  29. 29

    How can I make a similar shape to a parallelogram in css?

HotTag

Archive