I'm trying to transition from my current view controller self
to self.aVC
using view controller containment using self.navigationController
as the container. When I run the following code, the "children view controllers must have a common parent view controller" error pops up but the two NSLogs show the same parentViewController.
What seems to be the problem here? Any help is appreciated.
[self willMoveToParentViewController:nil];
[self.navigationController addChildViewController:self.aVC];
[self.aVC.view setFrame:self.bottomFrame];
NSLog(@"%@",self.parentViewController);
NSLog(@"%@",self.aVC.parentViewController);
// __weak __block SBSomeVC *weakSelf = self;
[self transitionFromViewController:self toViewController:self.aVC duration:0.3 options:UIViewAnimationOptionTransitionNone animations:^{
[self.aVC.view setFrame:self.view.bounds];
} completion:^(BOOL finished) {
[self.aVC didMoveToParentViewController:self.navigationController];
[self removeFromParentViewController];
}];