I have added a viewcontroller's view as a child view in an another viewcontroller. The child view controller has a tableview. Child view controller can be pushed more than once while click on didSelectRow
to show updated data in same viewcontroller which is working fine. But when I push the child view controller from my parent view the child view changes its frame to original viewcontroller frame and leave the parent view. So I want to make sure that it will always stay in the frame of its parent view and push and pop will occured only inside parent view.
Adding child view:
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Home" bundle:nil];
ChildViewController *vc = [sb instantiateViewControllerWithIdentifier:@"ChildViewController"];
[self addChildViewController:vc];
[vc.view setFrame:self.tableFilters.frame];
[self.viewContainer addSubview:vc.view];
[vc didMoveToParentViewController:self];
Code written in Child viewcontroller's didSelctRow method:
ChildViewController *newMyTableVC = [self.storyboard instantiateViewControllerWithIdentifier:@"ChildViewController"];
newMyTableVC.delegate = self;
[self.tableView reloadData];
[self.navigationController pushViewController:newMyTableVC animated:YES];