I want users to get a different result if they click on an accessory image in a table cell rather than the row.
To capture their tap on the accessory, I am using following method:
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath;{
NSLog(@"accessory button tapped");
}
In addition, I am not using the standard indicators. Instead, I am using custom images as follows:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
[cell setAccessoryView:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"checkmark.png"]]];
}
that overrides the standard accessory button and shows an image. Note: It shows the image no matter what the disclosure indicator is set to in storyboard, none, checkmark, disclosure indicator, etc.
However, currently, the
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath;{
NSLog(@"accessory button tapped");
}
method is not firing.
There are some answers on SO that suggest this method is not called if the accessory is an accessory view as opposed to accessory type.
Does anyone know if it is possible to use custom images and still get button tapped method to fire?