UITapGestureRecognizer in custom UITableViewCell within UIPicker is not working
<p>I am trying to implement <strong>multiselect option</strong> in <code>UIPicker</code> using <code>setAccessoryType</code> in <code>UITableViewCell</code> and following @<a href="http://suda.pl/multiple-row-selection-in-uipickerview/" rel="nofollow">Suda's blog</a></p>

<p><strong>Now the Problem is :</strong> <em>Not getting any error but <code>UITapGestureRecognizer</code> is not getting recognized. 
<code>toggleSelection:</code> is not getting called (not able to add / remove object in <code>selectedItems</code>).</em></p>

<blockquote>
  <p>I have searched for this problem in SO but didn't get any solution. nothing is working for me.</p>
</blockquote>

<p>I have used following code</p>

<p><strong>ViewController.h</strong></p>

<pre><code>#import &lt;UIKit/UIKit.h&gt;

@interface ViewController : UIViewController&lt;UIPickerViewDelegate, UIPickerViewDataSource&gt;
{
    NSMutableArray *selectedItems;
    NSArray *datasource;
}
@property (weak, nonatomic) IBOutlet UIPickerView *pickerView;
@end
</code></pre>

<p><strong>ViewController.m</strong></p>

<pre><code>- (void)viewDidLoad {
    [super viewDidLoad];
    datasource = [[NSArray alloc] initWithObjects:@"A", @"B", @"C", @"D", @"E", nil];
    self.pickerView.delegate = self;
    self.pickerView.dataSource = self;
    selectedItems = [[NSMutableArray alloc] init];
}

-(NSInteger) numberOfComponentsInPickerView:(UIPickerView *)pickerView {
    return 1;
}

-(NSInteger) pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
    return datasource.count;
}

-(NSString*) pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
    return datasource[row];
}

- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view {
    UITableViewCell *cell = (UITableViewCell *)view;
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
        [cell setBackgroundColor:[UIColor clearColor]];
        [cell setBounds:CGRectMake(0, 0, cell.frame.size.width - 20, 44)];
        cell.tag = row;
        UITapGestureRecognizer * singleTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(toggleSelection:)];
        singleTapGestureRecognizer.numberOfTapsRequired = 1;

        [cell setUserInteractionEnabled:YES];
        [cell addGestureRecognizer:singleTapGestureRecognizer];
        // Also tried with [cell.contentView addGestureRecognizer:singleTapGestureRecognizer];
    }
    if ([selectedItems indexOfObject:[NSNumber numberWithInt:row]] != NSNotFound) {
        [cell setAccessoryType:UITableViewCellAccessoryCheckmark];
    } else {
        [cell setAccessoryType:UITableViewCellAccessoryNone];
    }
    cell.textLabel.text = [datasource objectAtIndex:row];
    return cell;
}

- (void)toggleSelection:(UITapGestureRecognizer *)recognizer {
    NSNumber *row = [NSNumber numberWithInt:recognizer.view.tag];
    NSUInteger index = [selectedItems indexOfObject:row];
    if (index != NSNotFound) {
        [selectedItems removeObjectAtIndex:index];
        [(UITableViewCell *)(recognizer.view) setAccessoryType:UITableViewCellAccessoryNone];
    } else { 
        [selectedItems addObject:row];
        [(UITableViewCell *)(recognizer.view) setAccessoryType:UITableViewCellAccessoryCheckmark];
    }
}
</code></pre>

<p>Any help would be appreciable. </p>