This is a follow up question to Quicklook/QLPreviewController shows a blank page instead of pdf on ios 8 but works fine on iOS7.
In the last answer's comments, it appears as if someone got nesting a QLPreviewController inside a UINavigationController to work ("we add it to view, which is added to a UInavigationController"), and I'm wondering how that was done.
This all works in iOS7, but in iOS8, I can only see the document when I present the QLPreviewController independently.
This code works in iOS7/8:
QLPreviewController* previewController = [[QLPreviewController alloc] initWithNibName:nil bundle:nil];
previewController.dataSource = self;
previewController.delegate = self;
previewController.modalPresentationStyle = UIModalPresentationFullScreen;
[baseViewController presentViewController:previewController animated:NO completion:nil;
This code works only in iOS7 (in iOS8 I see the nav/toolbars, but a blank screen instead of the doc):
QLPreviewController* previewController = [[QLPreviewController alloc] initWithNibName:nil bundle:nil];
previewController.dataSource = self;
previewController.delegate = self;
previewController.modalPresentationStyle = UIModalPresentationFullScreen;
UINavigationController* navigationController = [[[UINavigationController alloc] init] autorelease];
[navigationController setViewControllers:@[anotherViewController]];
[anotherViewController addChildViewController:previewController];
[anotherViewController.view addSubview:previewController.view];
[baseViewController presentViewController:navigationController animated:NO completion:nil;