I am currently taking this sample website and showing in my web review. The web page is displayed correctly.
Now I'm trying to figure out what data is selected when the user clicked on uiwebview.
For this, I can get CGPoint for a tap using UITapGestureRecognizer.
-(void)singleTap:(UIGestureRecognizer *)gestureRecognizer
{
CGPoint touchPoint = [gestureRecognizer locationInView:myWebView];
NSString *js = [NSString stringWithFormat:@"document.elementFromPoint(%f, %f).toString()", touchPoint.x, touchPoint.y];
NSString * tagName = [myWebView stringByEvaluatingJavaScriptFromString:js];
NSLog(@"Selected Name: %@",tagName);
}
I want to get accurate data as soon as the user selects a vertical bar in the first graph (for example, 1994/1995/1996).
How to do it?
source
share