UIViewController showing cropped when presented from child view controller of UITabBarController

Originator:titouan.vanbelle
Number:rdar://31754837 Date Originated:April 21 2017, 6:00 PM
Status:Open Resolved:
Product:UIKit Product Version:
Classification: Reproducible:
 
Area:
UIKit

Summary:
Instead of sliding from the left side of screen and covering the screen entirely, the view controller is slide up and is only covering the top half of the screen.

Steps to Reproduce:
- Create an application using a tab bar controller
- Create a subclass of UIViewController with the following implementation

#pragma mark - UIViewController - Orientation

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return UIInterfaceOrientationLandscapeRight;
}

- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscape;
}

- (BOOL)shouldAutorotate
{
    return YES;
}

#pragma mark - NSObject

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.view.backgroundColor = [UIColor greenColor];
}

#pragma mark - UIViewController - Status Bar

- (BOOL)prefersStatusBarHidden
{
    return YES;
}


- Present the view controller created above from one of the view controller that belongs to the tab bar controller

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    self.modalViewController = [[ModalViewController alloc] init];

    [self presentViewController:self.modalViewController animated:YES completion:nil];
}

- Run the application

If the problem does not appear, run again form Xcode.

Expected Results:
The UIViewController should slide in from the left side of the screen and cover the whole screen 

Actual Results:
Sometimes: The UIViewController slides up and covers only the top half of the screen

Version:
iOS 10.3.1 (14E304)

Notes:
Screencast: https://raw.githubusercontent.com/TitouanVanBelle/Bug/master/Screencast.mov

Created a GitHub repository reproducing the issue

https://github.com/TitouanVanBelle/Bug

There is a UI Testing target with 20 tests that simply launch the app. When looking at the screenshots taken during the run you can see the problem.

Configuration:
Reproduced on iPhone 7 and iPhone 7 Simulator

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!