title: Swapping child views in a container view
body: <p>Let <code>ContainerView</code> be the parent container view with two child content views: <code>NavigationView</code> and <code>ContentView</code>.</p>
  
  <p><img src="https://i.stack.imgur.com/AUmRV.png" alt="Example of View Layout"></p>
  
  <p>I would like to be able to swap out the controller of <code>ContentView</code> with another view. For example, swapping a home page controller with a news page controller. Currently, the only way I can think to do this is by using a delegate to tell the <code>ContainerView</code> that I want to switch views. This seems like a sloppy way to do this because the <code>ContainerViewController</code> would end up having a bunch of special delegates for all of the subviews.</p>
  
  <p>This also needs to communicate with the <code>NavigationView</code> which has information about which view is currently in the <code>ContentView</code>. For example: if the user is on the news page, the navigation bar within the navigation view will show that the news button is currently selected.</p>
  
  <p><strong>Question A:</strong>
  Is there a way to swap the controller in <code>ContentView</code> without a delegate method calling the <code>ContainerView</code> itself? I would like to do this programmatically (no storyboard).</p>
  
  <p><strong>Question B:</strong>
  How can I swap controllers in <code>ContentView</code> from the <code>NavigationView</code> without a delegate call? I would like to do this programmatically (no storyboard).</p>