0

I am working on user interaction in different uiviews.

I know how to send user interaction on parent view or on it's specific UI components.

In my example, I am sending event to UIButton that is working properly even I tap on outside of UIButton bounds (Please take a look on attached code for more inside).

But I don't know that when I tapping on top view, UIButton TouchDown selector called but TouchUpInside not calling. Why is it happening?

Any suggestions? Any explanation is greatly appreciated!

Github code link: https://github.com/jackMac1811/iOSUIInteractionTest

Mohd Haider
  • 673
  • 1
  • 5
  • 25

1 Answers1

2

All uibutton events carrying their own behavior which enables to execute its bunch of code according to it.

if you want to invoke both methods tapping on top view you should have to use touch up outside instead of touch up inside event Here's a very useful link https://stackoverflow.com/a/11390048/4003548

Hope this helps ..

Community
  • 1
  • 1
vaibhav
  • 4,038
  • 1
  • 21
  • 51
  • If you have downloaded my test project from GitHub link. Then you can see that on tap on UIButton, we are getting NSLog for both selectors. TouchUpInside and TouchDown. I know about all UIButton touch methods. I am unable to understand that on tap outside of UIButton, we can get TouchDOwn selector called but TuchUpInside selector will not call. – Mohd Haider May 12 '16 at 11:37
  • 1
    A touch-up inside event works where the finger is inside the bounds of the uibutton and touch down event works outside the boundaries _kindly have a look of of that link i have mentioned_. – vaibhav May 12 '16 at 12:04
  • Thanks Vaibhav... I should read your previous link completely. Thanks for replying. – Mohd Haider May 12 '16 at 12:28