title: How to press on a tableview cell to present a view controller with the text in navigation controller
body: <p>Essentially I have a view controller called <strong>FirstViewController</strong>, this view controller contains a table view within it called <strong>listTableView</strong>.</p>
  
  <p>I would like to tap on one of the cells in the table view <strong>listTableView</strong> and present whatever text was in the cell as the navigation controller title.</p>
  
  <p>The navigation controller that appears when the cell is tapped is called <strong>showDetailsViewController</strong>. </p>
  
  <p>How can this be done?</p>
  
  <p>The following is what I have written in the <strong>FirstViewController</strong></p>
  
  <pre><code>import UIKit
  import AudioToolbox
  
  class FirstViewController: UIViewController, UITableViewDataSource, UITableViewDelegate, FeedModelProtocol  {
      var feedItems: NSArray = NSArray()
      var selectedStock : StockModel = StockModel()
      let tableView = UITableView()
      @IBOutlet weak var listTableView: UITableView!
      @IBOutlet weak var refreshButton: UIBarButtonItem!
  
      override func viewDidLoad() {
          super.viewDidLoad()
          //set delegates and initialize FeedModel
  
  
          self.listTableView.delegate = self
          self.listTableView.dataSource = self
  
          let feedModel = FeedModel()
          feedModel.delegate = self
          feedModel.downloadItems()
  
      }
  
      override var preferredStatusBarStyle: UIStatusBarStyle {
          return .lightContent
      }
  
      @IBAction func reloadData(_ sender: Any) {
  
          print("reload pressed")
          listTableView.reloadData()
          viewDidLoad()
          _ = AudioServicesPlaySystemSound(1519)
      }
  
  
  
      func itemsDownloaded(items: NSArray) {
  
          feedItems = items
          self.listTableView.reloadData()
      }
  
      func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          // Return the number of feed items
  
          print("item feed loaded")
          return feedItems.count
  
      }
  
      func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
  
          // Retrieve cell
          let cellIdentifier: String = "stockCell"
          let myCell: UITableViewCell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier)!
          myCell.textLabel?.textAlignment = .center
          myCell.textLabel?.font = .boldSystemFont(ofSize: 18)
          // Get the stock to be shown
          let item: StockModel = feedItems[indexPath.row] as! StockModel
          // Configure our cell title made up of name and price
  
  
          let titleStr = [item.customer].compactMap { $0 }.joined(separator: "-")
  
  
          print(titleStr)
          // Get references to labels of cell
          myCell.textLabel!.text = titleStr
  
          return myCell
      }
  
  }
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>What is the issue with this code:</p>
  
  <p><strong>NOTE:</strong>
  The restoration id of the tableview is <strong>scheduleTable</strong>     </p>
  
  <pre><code>var homeworkIdentifierFromTableViewCell = ""
      func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
  
          homeworkIdentifierFromTableViewCell = feedItems[indexPath.row].myCell
          self.performSegue(withIdentifier: "scheduleTable", sender: self)
          listTableView.deselectRow(at: indexPath, animated: true)
  
      }
  </code></pre>
  
  <p><strong>UPDATE 2</strong></p>
  
  <pre><code>func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
  
      let item: StockModel = feedItems[indexPath.row] as! StockModel
      let titleStr = [item.customer].compactMap { $0 }.joined(separator: "-")
      print(titleStr)
  
  
  }
  </code></pre>