Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • just past that code into cellForRowAt indexPath method of table view , its simple Commented Sep 13, 2017 at 6:05
  • this method is useful when u want to user interaction disable on table view otherwise you can use method share by Mr Ben Below Commented Sep 13, 2017 at 6:14
  • Works in Swift 4 also. Commented Dec 20, 2017 at 23:13
  • It is working fine for me. Should be the correct answer. Another way is that in tableView:didSelectRowAtIndexPath delegate method, detect cell index and just do nothing and return. Commented Sep 7, 2018 at 17:10
  • My favorite part about this answer is that you can declare it INSIDE the cell. If you have a cell (like an empty state cell) that you never want to respond to taps, this is a good way to go. Commented Jul 1, 2020 at 21:40