title: UIViewController containment notifications
body: <p>I have a doubt about UIViewController containment. For simplicity, I made a sample project and defined SecondViewController class.</p>
  
  <pre><code>class SecondViewController: UIViewController {
  
  override func viewDidLoad() {
      super.viewDidLoad()
      self.view.backgroundColor = UIColor.black
      NSLog("In second controller")
  
      // Do any additional setup after loading the view.
  }
  
  override func willTransition(to newCollection: UITraitCollection, with coordinator: UIViewControllerTransitionCoordinator) {
      NSLog("Transitioning in second controller")
    }
   }
  </code></pre>
  
  <p>And in first controller, I do the following:</p>
  
  <pre><code>class ViewController: UIViewController {
  
  override func viewDidLoad() {
      super.viewDidLoad()
      // Do any additional setup after loading the view, typically from a nib.
  
      let secondController = SecondViewController()
      addChild(secondController)
      view.addSubview(secondController.view)
      secondController.view.frame = self.view.bounds
      secondController.didMove(toParent: self)
  }
  
  override func willTransition(to newCollection: UITraitCollection, with coordinator: UIViewControllerTransitionCoordinator) {
      NSLog("Transitioning in first controller")
     }
   }
  </code></pre>
  
  <p>When I run the program, it runs and here are the logs:</p>
  
  <pre><code>2018-09-28 19:11:15.491211+0400 ViewContainment[3897:618645] In second controller
  2018-09-28 19:11:17.254221+0400 ViewContainment[3897:618645] Transitioning in first controller
  </code></pre>
  
  <p>Questions:</p>
  
  <ol>
  <li><p>Does that mean all the UIViewController notifications will be handled by first view controller, and no notifications will be sent to the second view controller?</p></li>
  <li><p>Is it safe to add actions for button clicks in second view controller to selectors in first view controller?</p></li>
  </ol>