title: tableview sent me an error when I tried to present a uiview in front of it
body: <p>I'm new with Xcode and Swift, following a tutorial and I found a problem when I called a UIView in front of a tableview so the user can create something new</p>
  
  <p>NOTE: I already tried what this <strong><a href="https://stackoverflow.com/questions/32170456/what-does-fatal-error-unexpectedly-found-nil-while-unwrapping-an-optional-valu">link</a></strong> shows with no luck to resolve my issue</p>
  
  <p>I am using Xcode 11.3.1 and Swift</p>
  
  <p>This is my code</p>
  
  <p>Channel Model</p>
  
  <pre><code>import Foundation
  
  struct Channel : Decodable {
      public private(set) var channelTitle: String!
      public private(set) var channelDescription: String!
      public private(set) var id: String!
  }
  Class ChannelCell
  
  import UIKit
  
  class ChannelCell: UITableViewCell {
  
      // Outlets
      @IBOutlet weak var channelName: UILabel!
  
  
      override func awakeFromNib() {
          super.awakeFromNib()
          // Initialization code
      }
  
      override func setSelected(_ selected: Bool, animated: Bool) {
          super.setSelected(selected, animated: animated)
          if selected {
              self.layer.backgroundColor = UIColor(white: 1, alpha: 0.2).cgColor
          } else {
              self.layer.backgroundColor = UIColor.clear.cgColor
          }
      }
  
      func configureCell(channel: Channel) {
          let title = channel.channelTitle ?? ""
          channelName.text = "#\(title)"
      }
  }
  </code></pre>
  
  <p>Channel View Controller</p>
  
  <pre><code>import UIKit
  
  class ChannelVC: UIViewController, UITableViewDelegate, UITableViewDataSource {
  
      // Outlets
  
      @IBOutlet weak var loginBtn: UIButton!
      @IBOutlet weak var userImg: CircleImage!
      @IBOutlet weak var tableView: UITableView!
      @IBAction func prepareForUnwind(segue: UIStoryboardSegue) {}
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          tableView.delegate = self &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; here I get the error message ***
  Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
          tableView.dataSource = self
  
  
          self.revealViewController()?.rearViewRevealWidth = self.view.frame.size.width - 60
          NotificationCenter.default.addObserver(self, selector: #selector(ChannelVC.userDataDidChange(_:)), name: NOTIF_USER_DATA_DID_CHANGE, object: nil)
      }
  
      override func viewDidAppear(_ animated: Bool) {
          setupUserInfo()
      }
  When I pressed the add channel button comes the problem
  
      @IBAction func addChannelPressed(_ sender: Any) {
          if AuthService.instance.isLoggedIn {
              let addChannel = ChannelVC()
              addChannel.modalPresentationStyle = .custom
              present(addChannel, animated: true, completion: nil)
          } else {
              performSegue(withIdentifier: TO_LOGIN, sender: nil)
          }
      }
  
      @IBAction func loginBtnPressed(_ sender: Any) {
          if AuthService.instance.isLoggedIn {
              let profile = ProfileVC()
              profile.modalPresentationStyle = .custom
              present(profile, animated: true, completion: nil)
          } else {
             performSegue(withIdentifier: TO_LOGIN, sender: nil)
          }
      }
  
      @objc func userDataDidChange(_ notif: Notification) {
          setupUserInfo()
      }
  
      func setupUserInfo() {
          if AuthService.instance.isLoggedIn {
              loginBtn.setTitle(UserDataService.instance.name, for: .normal)
              userImg.image = UIImage(named: UserDataService.instance.avatarName)
              userImg.backgroundColor = UserDataService.instance.returnUIColor(components: UserDataService.instance.avatarColor)
          } else {
              loginBtn.setTitle("Login", for: .normal)
              userImg.image = UIImage(named: "menuProfileIcon")
              userImg.backgroundColor = UIColor.clear
          }
      }
  
      // Protocols for UITableViewDataSource
      // # of sections
      // # rows in the section
      // function to setup the cells
  
      func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          if let cell = tableView.dequeueReusableCell(withIdentifier: "channelCell", for: indexPath) as? ChannelCell {
  I double check the reusable identifier is OK
  
              let channel = MessageService.instance.channels[indexPath.row]
              cell.configureCell(channel: channel)
              return cell
          } else {
              return UITableViewCell()
          }
      }
  
      func numberOfSections(in tableView: UITableView) -&gt; Int {
          return 1
      }
  
      func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          if MessageService.instance.channels.count == 0 {
              tableView.setEmptyView(title: "Message!", message: "You don´t have any channel, create a new one")
          }
          return MessageService.instance.channels.count
      }
  }
  </code></pre>
  
  <p>this is the view I want to show when I click on the addChannel function 
  <a href="https://i.stack.imgur.com/Pe5NQ.jpg" rel="nofollow noreferrer">view to present</a></p>
  
  <p>and this is the debug area
  <a href="https://i.stack.imgur.com/u3Ncv.jpg" rel="nofollow noreferrer">debug area</a></p>