I use a UIGestureRecognizer:

```
panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(gestureHandler:)];
panGestureRecognizer.delegate = self;

```

Now, I want to be able to set the state of the GestureRecognizer to UIGestureRecognizerStateEnded so when I enter

```
- (void)foldToGallery:(UIPanGestureRecognizer*)gesture

```

It will perform the code under:

```
if (gesture.state == UIGestureRecognizerStateEnded

```

and ignore the rest of the gesture until I will start a new one