title: How to avoid memory leaks with child viewControllers
body: <p>imagine a ViewController which is comprised of multiple child ViewControllers as depicted below:</p>
  
  <pre><code>ViewController1:
  - ViewController2
  - ViewController3
  </code></pre>
  
  <p>ViewController2 does not change so it is defined on the Storyboard with containerViews. In order to get reference of ViewController2 by ViewController1 I do the following:</p>
  
  <pre><code>override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
          let destination = segue.destination
          if let viewController2 = destination as? ViewController2 {
              self.viewController2 = viewController2
          }
     }
  </code></pre>
  
  <p>As for ViewController3, it is dynamic so it is added programmatically in ViewController1 like so:</p>
  
  <pre><code>    addChildViewController(viewController3)
      view.addSubview(viewController3.view)
      viewController3.didMove(toParentViewController: self)
  </code></pre>
  
  <p>My question is, for both these scenarios, what is the proper way of handling the memory management of the references of viewController2 and viewController3. Should they be weak or strong references?</p>
  
  <p>Thanks!</p>