7

I want to provide my own action sheet or popover, don't want default system one.

Please notice that:

  1. I'm asking about long press not click.
  2. I need to know the URL of the link that is being long pressed.
1

1 Answer 1

11

In order to provide your own action sheet or popover, first you need to disable the default contextual menu. You can do it with javascript by using the following code, inside webViewDidFinishLoad

[webView stringByEvaluatingJavaScriptFromString:@"document.body.style.webkitTouchCallout='none';"];

Once you disable the default behavior you can create your own custom action sheet/popover.

One possible approach is described in the following link:

Customize the contextual menu of UIWebView

1
  • 1
    Is there anyway to intercept the image that was tapped on?
    – jjxtra
    Jan 10, 2014 at 0:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.