title: viewWillAppear and viewDidAppear did not called when I add subview
body: <p>I know there are some questions related to this topic,
  I did some research, none of them worked for me.</p>
  
  <p>so I have a tableView and I am adding a collectionView Controller as child view controller to one of the cell. </p>
  
  <p>here's my code in tableview controller </p>
  
  <pre><code>  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
  
          cell.contentView.backgroundColor = .red
  
          let vcToAdd = storyboard?.instantiateViewController(withIdentifier: "MainCollectionViewController") as? MainCollectionViewController
  
          self.addChildViewController(vcToAdd!)
          vcToAdd?.willMove(toParentViewController: self)
          cell.contentView.addSubview((vcToAdd?.collectionView)!)
          vcToAdd?.didMove(toParentViewController: self)
  
          vcToAdd!.collectionView!.translatesAutoresizingMaskIntoConstraints = false
          vcToAdd?.collectionView?.leftAnchor.constraint(equalTo: cell.contentView.leftAnchor, constant: 0).isActive = true
          vcToAdd?.collectionView?.rightAnchor.constraint(equalTo: cell.contentView.rightAnchor, constant: 0).isActive = true
          vcToAdd?.collectionView?.bottomAnchor.constraint(equalTo: cell.contentView.bottomAnchor, constant: 0).isActive = true
          vcToAdd?.collectionView?.topAnchor.constraint(equalTo: cell.contentView.topAnchor, constant: 0).isActive = true
  
          return cell
  
      }
  
  }
  </code></pre>
  
  <p>viewDidLoad in child view controller (collection view vc) is called,
  but not viewWillAppear and viewDidAppear, I pretty much read all related questions but still can't figure out why.</p>
  
  <p>could anyone point out what might be wrong? :/</p>
  
  <p>thanks </p>