title: TableView cannot detect when clicking on specific item
body: <p>Hey I have a working UITable that loads items from my array but now I need to make calls when I click on a specific item of my UITable</p>
  <p>I have my own class below my viewcontroller´s code where I can create it like this:</p>
  <pre><code>class TableDataSource: NSObject, UITableViewDataSource {
      func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          return items.count
      }
      
      func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          let identifier = &quot;\(UITableViewCell.self)&quot;
          let item = items[indexPath.row]
          let cell = tableView.dequeueReusableCell(withIdentifier: identifier) ?? UITableViewCell(style: .subtitle, reuseIdentifier: identifier)
          cell.textLabel?.text = item
          
          return cell
      }
      
      func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
          print(&quot;lol&quot;)
      }
      
      var items: [String] = []
      
      func attach(to view: UITableView) {
          // Setup itself as table data source (Implementation in separated extension)
          view.dataSource = self
          // Register element for dequeuing (All dequeuing element must register in table before)
          view.register(UITableViewCell.self, forCellReuseIdentifier: &quot;\(UITableViewCell.self)&quot;)
      }
  }
  </code></pre>
  <p>As you can see I have a didSelectRowAt where it should just print &quot;lol&quot; as a test but that does not work</p>
  <p>In order to initialize this UITable I do call it like this</p>
  <pre><code>    @IBOutlet weak var TableItemsView: UITableView!
       private let dataSource = TableDataSource()
      var nutList = [&quot;empty&quot;]
  </code></pre>
  <p>The I call my array from firebase and apply it to nutList:</p>
  <pre><code> if let document = document, document.exists {
                  self.nutList = document.get(&quot;nutList&quot;) as! [String]
                  self.dataSource.attach(to: self.TableItemsView)
                  self.dataSource.items = self.nutList
          } else {
                  print(&quot;No food...&quot;)
          }
  </code></pre>
  <p>Everything works it displays all items and stuff but when I click on one individual item it does not print what I want. Any ideas ?</p>