I have a UIStackView
and I am dynamically adding UIViewControllers
contained, here is my code;
[self addChildViewController:driverForm];
[self addChildViewController:marketingView];
[self.stackView insertArrangedSubview:driverForm.view atIndex:0];
[self.stackView insertArrangedSubview:marketingView.view atIndex:1];
[driverForm didMoveToParentViewController:self];
[marketingView didMoveToParentViewController:self];
After reading the documents it states I must call didMoveToParentViewController
.
The problem I am facing is, the actions on the final UIViewController
are not being called, but the first ViewController does. If I swap these round the first one works and the last one does not.