title: SwiftUI: what substitutes the Delegate protocol?
body: <p>Let's consider one of the most basic flow available, where you have a view with data that is filled using other secondary views. i.e. Settings. </p>
  
  <p>In the <code>Settings</code> view we have 2 items displayed:</p>
  
  <pre><code>SETTINGS
  A - Pick a Color 
  B - Pick a Country 
  </code></pre>
  
  <p>When user taps one of the items, the App will present a new view that can be used to select a color or another view that can be used to select a country. </p>
  
  <p>When the user is done with one of the selection views, the <code>Selection View</code> is closed and the selection is passed back to the <code>Settings</code> view that now displays the new info: </p>
  
  <pre><code>SETTINGS
  A - Green 
  B - Spain
  </code></pre>
  
  <p>With <code>delegates</code> and <code>protocols</code> we can easily implement this code just putting the <code>Settings</code> view as delegate for the <code>Colors</code> and the <code>Countries</code> view and implementing a specific method to receive user selection directly on the <code>Settings</code> view. </p>
  
  <p>How can we achieve the same flow with <code>SwiftUI</code>? 
  I'm reading about <code>@EnvironmentObject</code>, is this a case where <code>@EnvironmentObject</code> would work? how would you implement the case described above with <code>@EnvironmentObject</code>?</p>
  
  <p><em>Note: I've seen other similar questions but they were too specific for single cases. My question is broad and should generically apply to many differente cases.</em></p>