title: Delegate vs Unwind Segue for Passing Data to Parent Scene
body: <p>Since iOS 6, unwind segues have been available to navigate up the scene hierarchy.  I am trying to decide on the cleaner/better/preferred/more maintainable method for passing data to a parent view controller.  There are some questions that address this from the technical perspective (e.g. "if I have an unwind do I still need a delegate") but I can't find much that addresses the questions of pros/cons.</p>
  
  <p>Option 1: use a delegate.</p>
  
  <ul>
  <li>Done by passing in the parent view controller as a delegate adhering to a protocol.
  <ul>
  <li>Child calls the protocol method to return the data.</li>
  <li>If data validation is required by the Parent, return value/dict required to allow child to handle error.</li>
  </ul></li>
  <li>Overhead: Protocol definition and one method in the parent (for data validation and receipt).</li>
  </ul>
  
  <p>Option 2: use an unwind segue</p>
  
  <ul>
  <li>Done by calling the unwind segue from the child.
  <ul>
  <li>Child adds a segue on its scene by dragging a button or the storyboard itself to <code>Exit</code> and naming the segue so it can be with <code>performSegueWithIdentifier:sender</code></li>
  <li>Parent implements <code>returnFromSegueName</code> (user named method linked to that segue) to grab the data from the child.</li>
  <li>Data validation though can only be implemented by also implementing <code>canPerformUnwindSegueAction:fromViewController:withSender</code>
  <ul>
  <li>Data validation failure will require another property on the Child as this method only accepts a BOOL for return value.</li>
  </ul></li>
  </ul></li>
  <li>Overhead: Two methods, an extra property, plus Storyboard shenanigans.</li>
  </ul>
  
  <p>Overall, delegates are feeling like the cleaner way to go, but perhaps also antiquated.  Am I wrong to be leaning in that direction?</p>