Problem
You can select text in the WKWebView.
Desired Behaviour
You should not be able to select text in the webview at all.
What I've tried
- Loading
NSString * jsCallBack = @"window.getSelection().removeAllRanges();";
usingevaluateJavaScript:completionHandler:
- doing the above using
"document.documentElement.style.webkitUserSelect='none'"
webView.configuration.selectionGranularity = nil;
<-- This one doesn't make sense asselectionGranularity
can only take two predefined values, but it was worth a try.- Tried looking for a solution inside the storyboard, couldn't find a solution that wouldn't disable user interactions.
What I can not do
Changing the HTML/CSS code is not an option at this time, if I could change it this answer would probably work.