Toby Wilson
Toby Wilson

Reputation: 23

setting target for disclosure button on subclassed UITableViewCell

I've created a subclass of UITableViewCell to create some custom appearance and UI functionality ('swipe to reveal delete button').

Some of the cells are disclosure/detail disclosure type, and have a UIButtonTypeDetailDisclosure etc added manually. I cannot use the table view controllers' UITableViewCellAccessory for row at index path method.

The question is, how do I set the target of these manually added buttons so that they correctly send the didSelectRowAtIndexPath to their table view controller?

Upvotes: 0

Views: 2219

Answers (1)

Saturn
Saturn

Reputation: 151

There is no direct way of setting an action the accessory disclosure button. Though you can do this with delegate method

- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath

See if that works.

Upvotes: 4

Related Questions