Wednesday, 29 May 2013

Swipe gesture iOS


- (void)viewDidLoad
{
    [super viewDidLoad];


UISwipeGestureRecognizer *swipeRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self  action:@selector(swipeMethod:)];

swipeRecognizer.direction = UISwipeGestureRecognizerDirectionRight | UISwipeGestureRecognizerDirectionLeft;

 [self.view addGestureRecognizer:swipeRecognizer];


}

-(void)swipeMethod: (UISwipeGestureRecognizer *) sender
{
    NSLog(@"Swipe!");
// Perform actions
}