0

At first, take a look in my code. I have some different codes, changing only the UIGesture, like tap, pan, long... and all gestures. Just for test Heres one:

public class ....{    
    ...
       public override void ViewDidLoad ()
       {            
           Image1.UserInteractionEnabled = true;
           UIGestureRecognizer tapGesture = new UIGestureRecognizer (TapThat);
           dot1.AddGestureRecognizer (tapGesture);
       }
    ....

       public void TapThat(){
       //Do some action...
       }
    }

Another:

public class ....{    
    ...

       public override void ViewDidLoad ()
       {            
           Image1.UserInteractionEnabled = true;

           UITapGestureRecognizer panGesture = new UITapGestureRecognizer ((pg) => {
           //Do some action...
           });

           dot1.AddGestureRecognizer (panGesture);
       }
    ....

    }

This is two examples, but is missing some thing. I use the .State variable to get UIGestureState. When I tap the image and keep the finger without moving, nothing happens. But if I tap and drag it's change.

Just when I drag , the state come on log: State - Began.

If I keep moving: State - changed.

When I release: State - Ended.

What I need is in the exactly moment I tap the image, it's change to another image. Without drag, like a button.

It's clear?

This for IOS;

2
  • Use Began action if you want immediate feedback.
    – pronebird
    Dec 4, 2014 at 11:29
  • But the state began come after I tap the image and move the finger. It wasn't work.
    – Teask Nick
    Dec 4, 2014 at 11:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.