Text

Answered

How do I turn on erase scratch gesture and other gestures?

Hi! Creating an iOS app in swift. Two questions:

1) We've successfully integrated handwriting recognition in our project by integrating the Pod. We're having trouble finding where to switch on these gestures referenced in the link below. We especially want scratch to erase (or strike through). Please can you show where to turn this on? Also where to read to make our own gestures?

https://developer.myscript.com/docs/concepts/editing-gestures/

2) Please can you send me a link to code to create our own custom drawing pen size? Also, is there a way to turn on pressure sensitivity so the ink drawn reacts to the Apple Pencil? Makes ink appear thicker if user presses harder and thinner if user lightly draws. Please send any code or links to code.

Thank you!


Best Answer

Dear Amir,


thank for the update.


As you have noticed, we do not have a "gesture Listener"; Indeed, using the contentChanged is the idea one would have, but it is quite limited as not as easy that would be a gesture Listener.


On our side, we do not plan to have a gesture listener in the short term. Would it be possible to learn more about your use-case? What do you want to achieve? Indeed, this may help us in thinking of another way to proceed.


Thank you,


Best regards,


Olivier


Dear Amir,


Thank you for contacting us and your questions.


To answer these:

1-Are you using the "interactive mode" or the "off-screen" mode: https://developer.myscript.com/docs/interactive-ink/1.3/ios/advanced/off-screen-usage/

We guess you are using the off-screen mode, as the "interactive mode" as the gestures by default. In off-screen mode, gestures shall not be activated.


2-Custom stroker API is not available for iOS, it is only for Android.


Best regards,


Olivier

Thank you for getting back to me.

I am using MyScript interactive sdk in iOS and I know there are some useful gestures such as erase, highlight, line up, line down etc…

IInkEditorDelegate has callback function named “contentChanged” and this function is called when user ends touches.


image

My question is if I can know whether there was a gesture on the last touch event or not when contentChanged is called.

I am trying to get these gesture events by exporting block content to JIMX types and comparing all strokes with previous strokes, but this is not so good method.

So if there is a good method or callback functions for gesture events, let me know.

Thanks

Answer

Dear Amir,


thank for the update.


As you have noticed, we do not have a "gesture Listener"; Indeed, using the contentChanged is the idea one would have, but it is quite limited as not as easy that would be a gesture Listener.


On our side, we do not plan to have a gesture listener in the short term. Would it be possible to learn more about your use-case? What do you want to achieve? Indeed, this may help us in thinking of another way to proceed.


Thank you,


Best regards,


Olivier