I have a UITableViewCell with a small UIWebView that displays a youtube link. this is all got from - http://apiblog.youtube.com/2009/02/youtube-apis-iphone-cool-mobile-apps.html It works fine but only if you tap inside the UIWebView itself. I want the user to be able to tap anywhere in the tableview cell and grab that tap and pass it to the uiwebview so that tap starts the youtube video.
So I've created (in the screenshot, everything to the left of the webview) a button. Connected it to the follwing function:
I have tried to subclass uiwebview (for testing only) and I know I am getting the touchesEnded. But the video isn't starting and I'm not sure at this point what else I can try or what component I need to send the touchesEnded to.
Or do anyone know how I can just send a touch to a uiwebview?
So I've created (in the screenshot, everything to the left of the webview) a button. Connected it to the follwing function:
Code:
- (IBAction)ytButtonPressed:(id)sender event:(id) event{
NSSet *touches = [event allTouches];
UITouch *touch = [touches anyObject];
CGPoint currentTouchPosition = [touch locationInView:tableView];
NSIndexPath *indexPath = [tableView indexPathForRowAtPoint: currentTouchPosition];
if (indexPath != nil) {
NSLog(@"getting the click in cell R:%i S:%i", indexPath.row, indexPath.section);
UITableViewCell *cell = (UITableViewCell *)[(UITableView *)tableView cellForRowAtIndexPath:indexPath];
LinkableWebView *wv = (LinkableWebView *)[cell viewWithTag:4];
//Send to the webview itself?
[wv touchesEnded:touches withEvent:event];
//send to the scrollView?
[[[wv subviews] objectAtIndex:0] touchesEnded:touches withEvent:event];
}
}
I have tried to subclass uiwebview (for testing only) and I know I am getting the touchesEnded. But the video isn't starting and I'm not sure at this point what else I can try or what component I need to send the touchesEnded to.
Or do anyone know how I can just send a touch to a uiwebview?