// add the below code in viewDidLoad method
swipeRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self
action:@selector(swipeMethod:)];
swipeRecognizer.direction = UISwipeGestureRecognizerDirectionRight | UISwipeGestureRecognizerDirectionLeft;
[self.view addGestureRecognizer:swipeRecognizer];
-(void)swipeMethod: (UISwipeGestureRecognizer *) sender
{
NSLog(@"swipe event detected");
}
// if we need means we use separate swipegesture for left, right, up and down direction
swipeRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self
action:@selector(swipeMethod:)];
swipeRecognizer.direction = UISwipeGestureRecognizerDirectionRight | UISwipeGestureRecognizerDirectionLeft;
[self.view addGestureRecognizer:swipeRecognizer];
-(void)swipeMethod: (UISwipeGestureRecognizer *) sender
{
NSLog(@"swipe event detected");
}
// if we need means we use separate swipegesture for left, right, up and down direction
No comments:
Post a Comment