Resolved gesture recognizer to recognize gestures in subviews

Discussion in 'iOS Programming' started by Apple souce, Feb 24, 2013.

  1. Apple souce, Feb 24, 2013
    Last edited: Feb 24, 2013

    Apple souce macrumors member

    Joined:
    Mar 15, 2012
    #1
    Hey guys,

    I'm trying to replicate the behaviour of the HUD in the Videos app (when watching a video). So to put it in words there is a custom view at the top of the screen which fades in and fades out after about 4 seconds. If you tap on the view or any of its subviews(UIButton, UISlider), the timer resets back to 0 and starts over.

    I have everything working except for that timer which should reset when a subview is tapped.

    Ive got a gesture recognizer on the custom view but the target-action method doesnt get called when I touch a subview.
     
  2. MattInOz macrumors 68030

    MattInOz

    Joined:
    Jan 19, 2006
    Location:
    Sydney
    #2
    What is the stacking order of the view that has the gesture attached?

    Check there isn't a view above that is stopping touches from being passed down the responder chain.
     
  3. Apple souce thread starter macrumors member

    Joined:
    Mar 15, 2012
    #3
    Thanks for the replay, I got it working at first using spaghetti code in the delegate method - gestureRecognizer:shouldReceiveTouch: but then I did a bit of fiddling around and it turned out
    Code:
    customView.canclesTouchesInView = NO;
    was what I was missing. After adding that, I no longer needed the delegate method.
    Thanks
     

Share This Page