Cell disclosure button and associated method

I struggled with the cell expansion button ... At first he said that it depreciates when I used:

-(UITableViewCellAccessoryType)tableView:(UITableView *)tableView accessoryTypeForRowWithIndexPath:(NSIndexPath *)indexPath {
 return UITableViewCellAccessoryDetailDisclosureButton;
}

So, I commented on this and added expansion to the cell in configureCell using:

cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.editingAccessoryType = UITableViewCellAccessoryNone;

However, now my disclosure button does nothing. What I need to add in order to make the disclosure button work. All my googling came up with other methods of impairment. Any help or pointers would be greatly appreciated.

+5
source share
3 answers

, , UITableViewCellAccessoryDetailDisclosureButton. ( UITableViewCellAccessoryDisclosureIndicator). tableView:accessoryButtonTappedForRowWithIndexPath:. ( , ) tableView:didSelectRowAtIndexPath:.

+14

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

Swift 3.0

func tableView(_ tableView: UITableView, accessoryButtonTappedForRowWith indexPath: IndexPath) {

}

: :

cell.accessoryType = .detailDisclosureButton
cell.accessoryType = .detailButton
0

All Articles