First, I want to say that this question does not solve my problem: Orientation problem when I set a RootViewController
My ipad application only works in landscape mode. When I'm changing the root controller, the new storyboard appears correctly. But, it appears in portrait mode and then rotates to the correct orientation. How can I specify the orientation before changing the root controller or tell the storyboards to display in landscape by default ? It is pretty ugly seing the rotation of the view just after the animation.
Also, the landscape left and right are set in the project property.
Here is the code when I change the root view controller.
UIStoryboard *editorStoryboard = [UIStoryboard storyboardWithName:@"EditorStoryboard" bundle:nil];
UISplitViewController *editorViewController = [editorStoryboard instantiateInitialViewController];
UINavigationController *navigationController = [editorViewController.viewControllers lastObject];
editorViewController.delegate = (id)navigationController.topViewController;
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
[UIView transitionWithView:appDelegate.window duration:0.5 options: UIViewAnimationOptionTransitionFlipFromLeft animations:^{
appDelegate.window.rootViewController = editorViewController;
} completion:nil];