Burhan Ahmad
Burhan Ahmad

Reputation: 728

UISwipeGestureRecognizer method not called?

In my Box2d game i try to use uiswipegesture to get the swipe gesture up and when i do in test project it works fine but when i implement in box2d game it does not called swipe action here is the code

{UISwipeGestureRecognizer *swipeGestureup = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(oneFingerSwipeUp)];
    [swipeGestureup setDirection: UISwipeGestureRecognizerDirectionUp ];



    [[[CCDirector sharedDirector] openGLView] addGestureRecognizer:swipeGestureup];

    [swipeGestureup release];}

and method is

-(void)oneFingerSwipeUp:(id)sender{

NSLog(@"swipe auction called");

[player jump];

}

Upvotes: 1

Views: 206

Answers (1)

Rinju  Jain
Rinju Jain

Reputation: 1694

{
  UISwipeGestureRecognizer *swipeGestureup = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(oneFingerSwipeUp:)];
  [swipeGestureup setDirection: UISwipeGestureRecognizerDirectionUp ];

  [[[CCDirector sharedDirector] openGLView] addGestureRecognizer:swipeGestureup];

  [swipeGestureup release];
 }

- (void)oneFingerSwipeUp:(UISwipeGestureRecognizer *)recognizer{
  NSLog(@"swipe auction called");

  }

Upvotes: 1

Related Questions