以非模态方式呈现 UIViewController?

wsh*_*cdr 5 objective-c uiviewcontroller ios

我有一个 UIViewController (称为 A),但有时我需要显示第二个 UIViewController (称为 B),因为我不想打扰 A 中的 UI 操作( A 仍然需要响应一些触摸操作),所以有什么方法以非模态方式显示B?

str*_*eem 3

尝试这个 :

[self addChildViewController:viewControllerB];
[self.view addSubview:viewControllerB.view];
Run Code Online (Sandbox Code Playgroud)