I have a programmatically created UIViewController
named as "VC" and on top of that I need to load my existing UIViewController
.
I used below code to do that, and it's working fine.
I can see my existing UIViewController
on "VC" but not detecting any of viewDidAppear
or viewWillAppear
in existing view controller.
I am getting data from viewDidAppear
and viewWillAppear
so all the time my existing view controller collection view is empty.
ExistingViewController* presObj= [self.storyboard instantiateViewControllerWithIdentifier:@"oad"];
[vc.view addSubview:presObj.view];
[self addChildViewController:presObj];
[presObj didMoveToParentViewController:self];