Rotate ViewController from Landscape to Portrait and Vice Versa
Sometimes it is necessary to show a UIViewController in both orientations portrait if e.g. a list view needs shown or landscape if e.g. a diagram needs to be shown. Doing this on Android is quite simple and there are a lot of tutorials how to get this thing done. However on iOS approaches for this problem are barely, neither Apple has documented a solution for this reason.
Today I did some google search concerning this problem and found a really great posting on Vast blog showing a simple to use solution.
If you are showing a digram as in my case, I would recommend to hide the NavigationBar to have more screen space for showing important information.
I have done the NavigationBar visibility change by using following method[self.navigationControllersetNavigationBarHidden: animated: within the if-part of swapControllersIfNedded which you can find in the Vast blog link.