A Grey/White/Black Page Is Rendered


While there can be a lot of reasons why you're experiencing this issue, the most common is improper use of view controllers.

Please read up on Apple's Guide for Child View Controller Containment.

To make it simple - adding the PSPDFViewController's view onto another view alone will not work. You need to connect the controllers as well.

Copy
1
2
3
4
5
6
func displayContentController(_ content: UIViewController) {
    addChildViewController(content)
    content.view.frame = frameForContentController()
    view.addSubview(currentClientView)
    content.didMove(toParentViewController: self)
}
Copy
1
2
3
4
5
6
- (void)displayContentController:(UIViewController*) content {
   [self addChildViewController:content];
   content.view.frame = [self frameForContentController];
   [self.view addSubview:self.currentClientView];
   [content didMoveToParentViewController:self];
}

ObjC.io has good content on this as well: http://www.objc.io/issue-1/containment-view-controller.html

Was this page helpful? We're happy to answer any questions.