title: Swift - Reuse the old instance of view when switch between Views and Passing data over views
body: <p>I am trying to create a simple app and here is how it works:</p>
  
  <p>When the user clicks the button "Picking", it'll show a tableview. And when the user selects a row in the table view, it will show the first view and display the data on the label.
  <a href="https://i.stack.imgur.com/jOkVh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jOkVh.png" alt="enter image description here"></a></p>
  
  <p>I have 2 problems:</p>
  
  <ol>
  <li><p>Every time I click the button "Picking", a new instance of the table view controller gets created; but does not reuse the existing one. How can I make it reuse the old one?</p></li>
  <li><p>I want to pass the selected data to the root view. I tried by creating a segue to show the root view when user selects a cell and then passing the data on <code>prepareForSegue</code> method. But, I faced the above problem of memory leak. How do I pass the data between screens without leaking memory?</p></li>
  </ol>