B4i Library GestureRecognizer - Native UIGestureRecognizer

Hi,

Added a small project with examples. There are simple ones, you need to hook up them per your needs.


This is a wrapper of UIGestureRecognizer.
All the gesture are supported: Tap, LongPress, Swipe, Pinch, Rotation, Pan, Screen Edge Pan.

See attached example. All the info in the project

Enjoy

Narek

UPDATED: Version 1.1

- getting the X and Y for all the gestures.


UPDATED: Version 1.2

-New function to get the center of a view and to set it
 

Attachments

Last edited:
Narek,

Thank you for the example! I'll give it a try later.

In the mean time, I noticed the version number in GestureRecognizer.bas was not updated to 1.2. It still says 1.1 although the content is different than the one in the example. I thought I'd mention this in case you meant to change the version number but forgot to do so :)

Thank you once again!

KC
 
I was having some troubles coming to grips with narek's class so I spent a day tidying it up and netting it down to its bare essentials.

I changed the example wrapper so that I could individually analyse how each gesture was handled.

I then added a mashup example of all gestures to the example wrapper with some simple ideas as to how to avoid gesture "collisions".

I've asked narek if he would mind my publishing this effort - he was positive with the caveat that I change the classes name to avoid confusion.

Please find the XGestureRecognizer class with example wrapper attached.

The example wrapper has the mashup exposed by default - there are simple instructions in the example wrapper that allow you to expose the individual gesture examples instead.
 

Attachments

Last edited:
Hi Guys

I am just wondering if anyone else is facing issues with this class.
Tap event not raised all the time ( in my case on average, 1 out of 10 fails)

In particular to be more specific, I am trying to simulate touch panel up event.
By pressing down on a panel and releasing after few seconds.

Thanks in advance
 
Narek, thank you for making this wrapperclass, saves a lot of work! I had to make minor adjustments to make it work and I'd like to share my two bugfixes:

Code:
Private Const mSwipeDirectionLeft=2
Everywhere you use "Private Const", the editor advises it is implicitly typed as string, so I added "As Int".
Code:
Private Const mSwipeDirectionLeft As Int = 2

And also
Code:
Type LongPress_Attributes(NumberOfTaps As InputStream, NumberOfTouch As Int, X As Float, Y As Float, Obj As Object)
InputStream should be Int
Code:
Type LongPress_Attributes(NumberOfTaps As Int, NumberOfTouch As Int, X As Float, Y As Float, Obj As Object)
 
Back
Top