I am making a rich text editor app. When app started, UIWebView loads a html file which contains a content editable div. When I touch a word, UIWebView shows a menu suggest some words instead of selected word. How can I turn off this menu?
That's what I say: https://i.stack.imgur.com/Xu4A9.png
This is my code:
- (void)viewDidLoad
{
webText=nil;
NSString *path = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"];
[self.editor loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:path]]];
self.editor.delegate=self;
[super viewDidLoad];
}
-(BOOL)canPerformAction:(SEL)action withSender:(id)sender
{
if (action == @selector(defineSelection:))
{
return NO;
}
else if (action == @selector(translateSelection:))
{
return NO;
}
else if (action == @selector(copy:))
{
return NO;
}
return [super canPerformAction:action withSender:sender];
}