Your decision depends on how you created the project.
If you used a view-based application template when creating a project, then you will have a view controller in MainWindow.xib. The controller of your view should work correctly both initially (at startup) and after turning the devices, provided that you have the status bar attribute enabled (i.e., gray or black is selected) for your view controller in this NIB.
If you used the Window-based Application template when creating the project, you need to add the following line of code to the delegate of your application didFinishLaunchingWithOptions:
myViewController.view.frame = window.screen.applicationFrame;
which is somehow magically configured correctly.
source share