Interactive Ink

how to enable

Hi, 

      I want to make the editor only recognize  the apple pencil, my problem is:

  1、if I set the inputMode to .forcePen   ,my finger also can write

  2、if I set the inputMode to .auto ,my finger can't not write ,but will move the inks or zoom in and zoom out.


how to forbid the finger or ,how to enable the moving and zooming?

 I'm using swift ,thank you 




Dear Qian Bin,


Currently, you can refer to the configureGestureRecognizer function you will find into the MainViewController.m file:


- (void)configureGestureRecognizer
{
    switch (self.editorViewController.inputMode)
    {
        case InputModeForcePen:
            self.longPressGestureRecognizer.enabled = NO;
            break;
        case InputModeForceTouch:
            self.longPressGestureRecognizer.enabled = YES;
            self.longPressGestureRecognizer.allowedTouchTypes = @[@(UITouchTypeDirect), @(UITouchTypeStylus)];
            break;
        case InputModeAuto:
            self.longPressGestureRecognizer.enabled = YES;
            self.longPressGestureRecognizer.allowedTouchTypes = @[@(UITouchTypeDirect)];
            break;
    }
}


Setting the allowedTouchTypes to @(UITouchTypeStylus) only, you should normally only allow to apple pencil to be used.


Best regards,


Olivier

Hi,

     Thank you very much! I solved the problem like this:  

 case InputModeAuto:
            self.panGestureRecognizer.enabled = NO;
            self.panGestureRecognizer.allowedTouchTypes = @[@(UITouchTypeStylus)];
            self.pinchGestureRecognizer.enabled = NO;
            self.pinchGestureRecognizer.allowedTouchTypes = @[@(UITouchTypeStylus)];
            break;

 Best regards

Dear Qian Bin,


thank you for the update, we are glad it is solved.


Feel free to contact us if you have any question!


Best regards,


Olivier