viewController = AViewController() case .b: viewController = BViewController() } // Add to ContainerView viewController.view.translatesAutoresizingMaskIntoConstraints = false addChild(viewController) containerViewController.addSubview(viewController.view) viewController.didMove(toParent: self) NSLayoutConstraint.activate([NSLayoutConstraint]) // Switch ViewController by Remote Config let viewController: UIViewController switch remoteConfig { case .a: viewController = AViewController() case .b: viewController = BViewController() default: viewController = DefaultViewController() } // Add to ContainerView viewController.view.translatesAutoresizingMaskIntoConstraints = false addChild(viewController) containerViewController.addSubview(viewController.view) viewController.didMove(toParent: self) NSLayoutConstraint.activate([NSLayoutConstraint]())