UITextView 禁止菜单

//! 禁止菜单 / 禁止某一个功能
  UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(100, 100, 300, 100)];
  [self.view addSubview:textView];
  textView.editable = NO;
  textView.text = @"我的我的我的我的我的我的我的我的我的我的我的我的我的我的";
  textView.selectable = NO;
- (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];
}

你可能感兴趣的:(UITextView 禁止菜单)