I want to disable copy/paste menu and i'm using HTML tag in UITextView
in which multiple hyperlinks and want to only disable menu.
My texview image
I want to disable copy/paste menu and i'm using HTML tag in UITextView
in which multiple hyperlinks and want to only disable menu.
My texview image
just try to create a subclass of UITextView that overrides the canPerformAction:withSender:
method
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
{
if (action == @selector(paste:))
return NO;
return [super canPerformAction:action withSender:sender];
}
You can play with this property:
and this one :
You need to create a subclass of UITextView and override the canPerformAction method.
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
{
if (action == @selector(copy:) || action == @selector(selectAll:) || action == @selector(paste:))
return NO;
return [super canPerformAction:action withSender:sender];
}