0

Presenting a view controller inside UIDocumentPickerExtensionViewController subclass overlaps the system navigation bar. The issue is only seen when compiled with Xcode 6.3 ( iOS 8.3 SDK ).

UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:myVC];
[self presentViewController:navController animated:NO completion:nil];

Any pointers would be helpful.

akc
  • 582
  • 2
  • 6
  • 23

3 Answers3

1

Try using (in viewDidLoad()):

self.edgesForExtendedLayout = UIRectEdgeNone;

This fixed the issue for us.

David M
  • 61
  • 4
0

Try to put this in the destination viewController viewDidLoad

[[self navigationController] setNavigationBarHidden:YES animated:NO];
[[self navigationController] setNavigationBarHidden:NO animated:NO];

I hope this is what you want.

lebasalte
  • 3
  • 3
0

This is the reply from Apple after filing the issue.

This is intentional behaviour. On iOS 8.3, we expose the navigation controller for you to push, so you don't need to supply your own. Try changing your code to

UIViewController* testVC = [[UIViewController alloc] init];
testVC.view.backgroundColor = [UIColor greenColor];
if(self.navigationController)
{
    [self.navigationController pushViewController:testVC animated:YES];
}
else
{
    UINavigationController* nc = [[UINavigationController alloc] initWithRootViewController:testVC];
    [self presentViewController:nc animated:NO completion:nil];
}

which should support both iOS 8.3 and previous releases.

akc
  • 582
  • 2
  • 6
  • 23