I have a UINavigationController with a root UIViewController ("root").
The root view controller pushes another child element of the UIViewController . When the “child” of the UIViewController displayed on the screen, I rotate the device and expect the “root” knob to be changed accordingly, but this will not happen. After setting a breakpoint in the root view controller:
-(void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator { [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; }
I see that the size is wrong, and the root view controller is not properly configured to resize.
Has anyone experienced this behavior?
The code is the same:
@interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; } -(void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {

Below is the NSLog size print screen after rotating the device. This is from the simulator, but the behavior on the device is the same.

source share