I am working on an epub reader, and currently moving from UIWebView to WKWebView.
I noticed that WKWebView allows user to select a picture, save it, share it or copy it.
I want to disable user from selecting a picture, but keep text selection available.
I do control the MenuItem of text Selection using the following:
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
if (action == @selector(copy:) || action == @selector(select:) || action == @selector(selectAll:) || action == @selector(share:) || action == @selector(lookUp:)) {
return NO;
}
else if (action == @selector(defineAction:) || action == @selector(highlightColor:) || action == @selector(Copying:)) {
return YES;
}
else {
return NO;
}
}
I was wondering if I can control or totally disable the MenuItem of picture selection
Kindly find below a screenshot where upon trying to select the text, sometimes the image gets selected instead and it allows the user to save the picture, which would lead to data infringement.
If any further code is needed kindly keep me posted.