title: How to keep text fields values after returning from modal in swift?
body: <p>I wonder how can I keep textfields input data when app do segue to a modal and return to the same page?</p>
  
  <p><strong>Scenario</strong>: I have a registration page with text fields and buttons, one of the buttons segue to a view controller that is represented as modal. Inside the modal there is a tableview, and when user click on the cell it returns data, and send user back to the registration page, but The fields get empty.</p>
  
  <p>What is the best way to do it? 
  the only solution I have in mind is to use NSDefaults, not sure if its a good approach.</p>
  
  <p><strong>Clarification:</strong></p>
  
  <p>I did the modal in storyboard, by adding a normal viewController.
  Then I connected a segue between the Button and the new viewController, and selected present modally.</p>
  
  <p>I specified a class for the modal "ModalVC", where it has tableview datasource and delegate functions.</p>
  
  <p>then I created another segue between table cell (the one inside ModalVC) to the registration page to send the data back.</p>
  
  <p>thanks</p>