首页 > 解决方案 > UIImagePickerController 未显示调试视图层次结构

问题描述

我创建并展示了一个 UIImagePickerController 并想看看它的构成。相反,我得到了这个:

调试视图层次结构

为什么调试视图层次结构没有显示 UIImagePickerController 及其所有视图,而是只显示一个黑色视图?我可以在技术上为我自己的视图和视图控制器做同样的事情吗?

标签: iosxcodecocoauiimagepickercontroller

解决方案


答案是 RemoteView[1]。iOS 有另一个项目来显示 ViewController 并将其流式传输到您的应用程序。远程进程使用 CALayerHost[2] 进入当前应用程序的上下文。PoC 示例(虽然不使用 XPC)[3]

[1] https://oleb.net/blog/2012/10/remote-view-controllers-in-ios-6/
[2] http://iphonedevwiki.net/index.php/CALayerHost
[3] https://github.com/freerunnering/libremoteview


推荐阅读