Search code examples
iosobjective-cuiviewcontrolleruicontainerview

Switching containerView content from within viewController


I have three viewControllers Main, A, B. Main ViewController holds ContainerView and other content as well does all transactions in containerView. ViewControllerA has ButtonA when pressing it content of container has to change to ViewControllerB how can I do that? I cannot find any similar examples.

enter image description here


Solution

  • While click on ButtonA. Post a notification to mainView. There remove viewController A from Container and add View Controller B .