I have a button which I would like to show and hide as the iOS MPMoviePlayer controls do when the video is tapped. Is there an better way to do this other than making my own gesture recognizer and timer for hiding/showing the button when the apple ones do?
Asked
Active
Viewed 101 times
1 Answers
1
That would be your best option. Here's roughly what it could look like:
UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(videoTapped:)];
[videoView addGestureRecognizer:recognizer];
...
- (void)videoTapped:(UITapGestureRecognizer *)recognizer {
[UIView animateWithDuration:0.25f animations:^{
buttonView.alpha = (CGFloat)!buttonView.alpha;
}];
}
Let me know if you have any other questions.

Dany Joumaa
- 2,030
- 6
- 30
- 45
-
Is this supposed to toggle? Cause I'm not sure it does that. – Morkrom Aug 13 '13 at 22:39