UITextView 禁止弹出复制

    UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPressAction)];

    longPress.minimumPressDuration = 0.5f;

    [textView addGestureRecognizer:longPress];

    

    UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(longPressAction)];

    doubleTap.numberOfTapsRequired = 2;

    [textView addGestureRecognizer:doubleTap];

    // 识别长按双击手势

    [longPress requireGestureRecognizerToFail:doubleTap];


  暂时没找到更好的办法,只是在textView上添加2个手势.


你可能感兴趣的:(UITextView 禁止弹出复制)