Skip to main content
Improved syntax
Source Link
José
  • 3.2k
  • 1
  • 34
  • 45

From UITableViewDataSource Protocol, inside method cellForRowAt add:

let cell = tableView.dequeueReusableCell(withIdentifier: "YOUR_CELL_IDENTIFIER", for: indexPath) cell.selectionStyle = UITableViewCell.SelectionStyle.none return cell 

OR

You can goto Storyboard > Select Cell > Identity Inspector > Selection and select none from dropdown.

From UITableViewDataSource Protocol, inside method cellForRowAt add:

let cell = tableView.dequeueReusableCell(withIdentifier: "YOUR_CELL_IDENTIFIER", for: indexPath) cell.selectionStyle = UITableViewCell.SelectionStyle.none return cell 

OR

You can goto Storyboard > Select Cell > Identity Inspector > Selection and select none from dropdown.

From UITableViewDataSource Protocol, inside method cellForRowAt add:

let cell = tableView.dequeueReusableCell(withIdentifier: "YOUR_CELL_IDENTIFIER", for: indexPath) cell.selectionStyle = .none return cell 

OR

You can goto Storyboard > Select Cell > Identity Inspector > Selection and select none from dropdown.

Source Link

From UITableViewDataSource Protocol, inside method cellForRowAt add:

let cell = tableView.dequeueReusableCell(withIdentifier: "YOUR_CELL_IDENTIFIER", for: indexPath) cell.selectionStyle = UITableViewCell.SelectionStyle.none return cell 

OR

You can goto Storyboard > Select Cell > Identity Inspector > Selection and select none from dropdown.