didSelectRowAtIndexPath when uiwebview fills cell?
-
07-07-2019 - |
Question
My controller inherits
UITableViewController
: <UITableViewDelegate,UITableViewDataSource>
The cells of the table are custom and are 100% filled by a UIWebView
I would like to have the user click anywhere in the UIWebView
and have the UITableViewDelegate's
function notified:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
Is there any suggestion to do like this?
Solution
when you create the UIWebView
set webView.userInteractionEnabled = NO;
If you need to allow user interaction within the web view and allow the user to click on the row as well, you'll probably need to do some UIView
subclassing as a wrapper around the UIWebView
for allowing you to cancel touches into the UIWebView
as necessary.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow