When I add child view controller to table view cell, it looks like viewWillAppear for child view controller is not called, only viewDidAppear.
Table View Controller method:
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
let cell = tableView.dequeueReusableCellWithIdentifier("ShopInfoTableViewCell", forIndexPath: indexPath) as! ShopInfoTableViewCell
self.addChildViewController(self.shopInfoViewController, toView: cell.containerView)
return cell
}
View Controller category method:
- (void)addChildViewController:(UIViewController *)childController toView:(UIView *)view
{
[self addChildViewController:childController];
[view addSubview:childController.view];
[childController didMoveToParentViewController:self];
[childController.view mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(view.mas_top);
make.bottom.equalTo(view.mas_bottom);
make.left.equalTo(view.mas_left);
make.right.equalTo(view.mas_right);
}];
}
Any ideas why it happen?