添加一个 UIViewController 作为当前视图的子视图
I feel like all of these answers are slightly incomplete, so here's the proper way to add a viewController's view as a subview of another viewController's view:
[self addChildViewController:viewControllerToAdd]; [self.view addSubview:viewControllerToAdd.view]; [viewControllerToAdd didMoveToParentViewController:self];
联系客服