Wednesday, June 29, 2011

how to use SwipeGestureRegognizer

// 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

No comments:

Create a list in SwiftUI with sticky section headers

 Sample Code import SwiftUI struct ContentView : View {     @State var isCustomViewControllerDisplayed = false     @State private va...