0
votes

I make in Swift a UITableview, and I want make that when somebody click on the cell he will be show a selection of this cell and when somebody click on the next cell the selection disappear from first selection and show in the next selection.

Example: I click on Cell1 - show now selection of this cell, When I click on Cell2 the Cell1 selection disappear and Cell2 show now selection.

Hope somebody can help me

1
Isn't this the default behavior of tableview?Zell B.

1 Answers

0
votes

Usethe didSelectRowAtIndexPath method and access the cell from it:

func tableView(tableView: UITableView!, didSelectRowAtIndexPath indexPath: NSIndexPath!) {
  //Do whatever you want with the cell
}