2

The scenario is like,

I have one UIButton in one UIView. So UIView is parent view and UIButton is child view.
Now,

  1. If I set user interaction false for parent view then can I click UIButton ?
  2. If I am not able to touch UIButton then why UIButton is not touchable?


Can you explain how UIButton will know it's parent view's user interaction is false?

Thanks,

Ankur
  • 5,086
  • 19
  • 37
  • 62
Nikh1414
  • 1,238
  • 2
  • 19
  • 35

1 Answers1

0

Similar question, check here

  1. No, you can't. userInteractionEnabled set to NO on a parent view will prevent to all subviews.

  2. Here is the documentation from Appel about "Event Delivery", check the link

  3. Check the property self.superView.userInteractionEnabled in hitTest:withEvent: method or pointInside:withEvent: method.

Community
  • 1
  • 1
swang
  • 250
  • 1
  • 11