The UIDocumentInteractionController to interact poorly with the new iOS 7 status bar, especially in landscape orientation. The code I have for showing the viewer right now:
- (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; NSString *filePath = [[NSBundle mainBundle] pathForResource:@"example" ofType:@"pdf"]; NSURL *url = [NSURL fileURLWithPath:filePath]; UIDocumentInteractionController *pdfViewer = [UIDocumentInteractionController interactionControllerWithURL:url]; [pdfViewer setDelegate:self]; [pdfViewer presentPreviewAnimated:YES]; } - (UIViewController *)documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)controller { return self; } - (UIView *)documentInteractionControllerViewForPreview:(UIDocumentInteractionController *)controller { return self.view; }
When the interaction controller first appears, the status bar overrides the header.

Turning to the landscape on the other hand temporarily captures behavior.

As expected, clicking on the document itself allows you to reject the frame. However, as soon as the document is tapped again to activate the frame, the overlap occurs again, as with the first image.
I tried installing documentInteractionControllerRectForPreview no avail.
- (CGRect)documentInteractionControllerRectForPreview:(UIDocumentInteractionController *)controller { return CGRectMake(0, 20, self.view.bounds.size.width, self.view.bounds.size.height); }
I donβt want to hide the status bar when the interaction controller appears, and I assume that it is possible to do it right, since the Mail application behaves correctly and it looks like it uses the same class.
Minimum sample project included for those who want to play with the code: https://hostr.co/PiluL1VSToVt
source share