title: UIButton not working loaded in a child ViewController
body: <p>I've got a <code>MainViewController</code> where I'm loading a slideout-menu. The MainViewController contains a static <code>TopView</code> and a <code>ContentView</code> where different child controllers or views are loaded, depending on which menu entry was selected.</p>
  
  <p>There is a button inside one of the children is loaded, but it is not working. 
  When I start the app with the ViewController including the button, set to "is initial View Controller", everything works properly.</p>
  
  <p>When starting the app with the <code>MainViewController</code> as initial View Controller with a loaded child, the button is not working (it is loaded in the view, but not reacting).
  Any suggestions how I can make this work?</p>
  
  <p><strong>MainViewController loading of Child View</strong></p>
  
  <pre><code>class MainViewController: UIViewController, SideBarDelegate {
  var contentView = UIView()
  
  override func viewDidLoad() {
      super.viewDidLoad()
      // Do any additional setup after loading the view, typically from a nib.
      ....
      contentView.backgroundColor = UIColor(red: 70/255, green: 174/255, blue: 253/255, alpha: 1)
      contentView.translatesAutoresizingMaskIntoConstraints = false
      self.view.addSubview(contentView)
      contentView.topAnchor.constraint(equalTo: statusBarView.bottomAnchor).isActive = true
      contentView.leadingAnchor.constraint(equalTo: self.view.leadingAnchor).isActive = true
      contentView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor).isActive = true
      contentView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor).isActive = true
      contentView.layoutIfNeeded()
  
  }
  
  func sideBarDidSelectButtonAtIndex(_ index: Int) {
      ...       
      if index == 0{
          statusBarLabel.text = "First"
          let controller:FirstViewController = storyboard!.instantiateViewController(withIdentifier: "First") as! FirstViewController
          controller.view.frame = ContentView.bounds
          controller.willMove(toParentViewController: self)
          contentView.addSubview(controller.view)
          controller.didMove(toParentViewController: self)
          print("touched index 0")
      } else if index == 1{
          // index is 1
      }
  }
  </code></pre>
  
  <p><strong>FirstViewController</strong></p>
  
  <pre><code>class FirstViewController: UIViewController, UIScrollViewDelegate {
  
      let addButton = UIButton()
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          self.view.backgroundColor = UIColor(red: 230/255, green: 230/255, blue: 230/255, alpha: 1)
  
          addButton.frame = CGRect(x: 0, y: 0, width: self.view.frame.size.width, height: 60)
          addButton.clipsToBounds = true
          addButton.setTitleColor(UIColor.white, for: .normal)
          addButton.backgroundColor = UIColor(red: 102/255, green: 204/255, blue: 255/255, alpha: 1)
          addButton.setTitle("add feed", for: .normal)
          addButton.titleLabel?.font = UIFont.systemFont(ofSize: 20, weight: UIFontWeightRegular)
          self.view.addSubview(AddButton)
          addButton.layoutIfNeeded()
          addButton.addTarget(self, action: #selector(touchUpAddButton), for: UIControlEvents.touchUpInside)
          addButton.addTarget(self, action: #selector(touchDownAddButton), for: UIControlEvents.touchDown)
  
      func touchUpAddButton() {
          addButton.backgroundColor = UIColor(red: 102/255, green: 204/255, blue: 255/255, alpha: 1)
      }
  
      func touchDownAddButton() {
          addButton.backgroundColor = UIColor(red: 70/255, green: 174/255, blue: 253/255, alpha: 1)
      }
  }
  </code></pre>