title: Connect Prototype Cells to View Controller [Swift 4]
body: <p>I am new to programming and currently working on a newsfeed like app. I had a normal Table view up and running fine, but want to try it now with a costume cell type. So I created one and thought connecting the labels the usual way would be perfectly fine, but I was wrong. So I am wondering how I can let my Text label connect to my view controller, so I can use my custom cell.</p>
  
  <pre><code>class ViewController: BaseViewController, UITableViewDelegate, UITableViewDataSource {
  
  @IBOutlet var newsfeedTableView: UITableView!
  
  var ref: DatabaseReference!
  
  var posts = [String]()
  
  
  func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return (posts.count)
  }
  
  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
      let cell = UITableViewCell(style: UITableViewCell.CellStyle.default, reuseIdentifier: "cell")
  
  //here is where I need the custom label to get the posts 
      cell.textLabel?.text = posts[indexPath.row]
      cell.textLabel?.font = UIFont.boldSystemFont(ofSize: 18.0)
  
      return cell
   }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/3upZY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3upZY.png" alt="Costum cell"></a></p>