title: Prepare for segue not sending info when button is pressed
body: <p>I'm learning how to pass data between controllers when a button is pressed, so I'm following this answer: <a href="https://stackoverflow.com/questions/26207846/pass-data-through-segue">Pass data through segue</a>, But I can't make it work, I have 3 buttons and I want to know which button was pressed, so my code in HomeView is: </p>
  
  <pre><code>   var buttonPressed: String?
  
      @IBAction func newsTapped(_ sender: Any) {
  
          buttonPressed = "news"
          self.performSegue(withIdentifier: "showNext", sender: buttonPressed)
      }
  
  
      @IBAction func tipsTapped(_ sender: Any) {
          buttonPressed = "tips"
          self.performSegue(withIdentifier: "showNext", sender: buttonPressed)
      }
  
  
      @IBAction func otherTapped(_ sender: Any) {
          buttonPressed = "other"
          self.performSegue(withIdentifier: "showNext", sender: buttonPressed)
      }
  
  
      override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
          let data = buttonPressed
          if let destinationViewController = segue.destination as? TableViewController {
                  destinationViewController.origin = data
          }
  </code></pre>
  
  <p>And the code in destinationView (TableViewController) is: </p>
  
  <pre><code>    var origin: String?
  
      override func viewDidLoad() {
       if let dataRecived = origin
       switch dataRecived {
  
  
                  case "news":
  
                      print("News")
  
                  case "tips":
  
                      print("Tips")
  
                  case "other":
                      print("Other") 
      }
  
  }
  </code></pre>
  
  <p>When I click any of the buttons, it takes me to the TableViewController, but doesn't print anything, I added the If let, since it crashed when the statement was: <code>if let dataRecived = origin</code>, now it never gets inside the if let statement. If I show the content of the variable (mouse over variable in xCode) it shows: <code>""</code></p>
  
  <p>Any ideas why it isn't working? Not sure if it has something to do, but HomeView is a ViewController, linked to a Navigation controller that has a TableView (which is destinationView. Thanks for your help</p>