How to disable long touch in UIWebView?

Alex Terente picture Alex Terente · Nov 30, 2010 · Viewed 12.7k times · Source

I want to disable long-touch from the application. I have no control on the HTML that I am loading on my WebView.

Answer

Alex Terente picture Alex Terente · Apr 5, 2011

In webViewDidFinishLoad delegate I run a javascript on the loaded html page that disable the long touch.

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