Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>write only the following codes in SwipeRecognizer.</p> <pre><code>- (void) SwipeRecognizer:(UISwipeGestureRecognizer *)sender { if ( sender.direction == UISwipeGestureRecognizerDirectionLeft ) { NSLog(@" *** SWIPE LEFT ***"); index1++; [self.feedsTableView reloadData]; } if ( sender.direction == UISwipeGestureRecognizerDirectionRight ){ NSLog(@" *** SWIPE RIGHT ***"); index1--; [self.feedsTableView reloadData]; } } </code></pre> <p>and write tableview delegate method (for Data) as the following:</p> <pre><code>- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { return [self.categoriesLabelArray objectAtIndex:index1]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { if(index1 == 0) //set tableCellDataArray if(index1 == 1) //set tableCellDataArray if(index1 == 2) //set tableCellDataArray //... //... if(index1 == n) //set tableCellDataArray } </code></pre> <p>and yes don't forget to add the following to viewDidLoad method</p> <pre><code>- (void)viewDidLoad { leftswipe = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(SwipeRecognizer:)]; leftswipe.delegate = self; leftswipe.direction = UISwipeGestureRecognizerDirectionLeft; rightswipe = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(SwipeRecognizer:)]; rightswipe.delegate = self; rightswipe.direction = UISwipeGestureRecognizerDirectionRight; [self.feedsTableView addGestureRecognizer: leftswipe]; [self.feedsTableView addGestureRecognizer: rightswipe]; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload