Question

I have a MPMoviePlayerViewController and I put a UIView on top of it to recognise single tap then I can show a control panel for the video, and double tap should zoom in/out the video play, so I set numberOfTapsRequired=1 for the gesture recogniser, but when I do a double-tap, the video is not zoom but the control panel is displayed and then disappeared as if there were two single taps.

is there anyway to solve it?

Thanks!

Was it helpful?

Solution

Yes. [UIGestureRecognizer requireGestureRecognierToFail:] is for exactly this purpose. Set your single tap gesture recognizer to require the double-tap gesture recognizer to fail. If it doesn't fail, then the zoom happens. If it does fail (i.e. you have only tapped once instead of twice) then your control panel will show.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top