如何禁用弹出菜单项,例如选择、全选、建议...、定义 (在 UIWebView
) 上?
我在帮助上找到了以下信息,但不明白如何使用:
For the editing menu commands, this is the shared UIApplication object. Depending on the context, you can query the sender for information to help you determine whether a command should be enabled.
最佳答案
调整以下方法:
#import "NSObject+myCanPerformAction.h"
@implementation NSObject (myCanPerformAction)
- (BOOL)myCanPerformAction:(SEL)action withSender:(id)sender {
if (action == @selector(copy:)) {
return [self myCanPerformAction:action withSender:sender]; // not a recursion
}
if (action == @selector(paste:)) {
return [self myCanPerformAction:action withSender:sender]; // not a recursion
}
return NO;
}
@end
混合:
[[UIWebDocumentView class] jr_swizzleMethod:@selector(canPerformAction:withSender:) withMethod:@selector(myCanPerformAction:withSender:) error:nil];
关于iphone - 如何禁用弹出菜单项,如选择、全选、建议...、定义(在 UIWebView 上)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13233613/