title: Moving data to and from viewcontrollers when NOT using storyboard (so without segues), how do you actually implement those delegates? - Swift
body: <p>I'm trying to work through this tutorial: <a href="https://cocoacasts.com/implement-the-nsfetchedresultscontrollerdelegate-protocol-with-swift-3" rel="nofollow noreferrer">https://cocoacasts.com/implement-the-nsfetchedresultscontrollerdelegate-protocol-with-swift-3</a> 
  But I found him using the <code>Storyboard</code> and <code>segues</code> to move data between <code>ViewControllers</code>. Yet I can not find a proper and safe way to move data from one <code>UIViewController</code> and another. </p>
  
  <p>Everyone always throws around <em>'oh you just need a delegate and protocol'</em> or <em>'use singletons'</em> or <em>'please never use singletons'</em>. All I could find in the last six hours of reading on protocols and delegates are superficial examples of weddings, puppies and tanks, but nowhere a proper way to do this. 
  The only thing I could find is in objective-C, which I sadly don't read or write. Even the questions on Stackoverflow that asked the same question don't have the answer, since the explanation is usually vague and in the category of <em>'I do it like this because it works, you too should do it like this. It works now.'</em>, without further explanation.</p>
  
  <p>Now moving something towards a VC when you use the <code>present()</code> function is easy, but backwards is the real problem, since the same trick doesn't work when you use <code>dismiss()</code> or <code>popViewController()</code>.</p>
  
  <p>Nowhere can I find a proper way to move data (like in the tutorial's case an NSManagedObjectContext object) between VCs with delegates and protocols. </p>
  
  <p>Surely I'm not the only one wondering, and a good explanation of the different ways with some example code would be helpful for others than me as well. </p>
  
  <hr>
  
  <p>So my questions remain: <strong>How do you move information between viewControllers without Storyboard and without Segues in Swift? And if delegates and protocols are the answer, what is the proper way to do this?</strong> </p>
  
  <p>EDIT: it is different from the other question on this topic (<a href="https://stackoverflow.com/questions/5210535/passing-data-between-view-controllers">Passing Data between View Controllers</a>) because this question is asked in Swift, not in Objective-C</p>