What to do if you have a framework that provides a modal view controller for iPad to do some actions, but it only allows to be presented in portrait orientation, and your app supports landscape orientation only? It looked very weird when the user uses the app in landscape mode, clicks a button, and the view swipes from left, rotated 90 degrees clockwise. You have no source code to change that. In my case, there was no reason to limit the supported orientations of the framework’s controller, as it could easily fit in landscape-oriented screen.
The first thought that popped up in my head was to apply transformations to rotate the view. It’s a very hacky solution though, thus it can be used as a last resort.
Luckily, due to the dynamic nature of Objective-C, I managed to rotate the view with the help of the category:
FrameworkController+OrientationFix.h
1234567
/* The category fixes FrameworkController's not supporting landscape orientation out of box. It also hides the application's status bar. Works on iPad only. */@interfaceFrameworkController(OrientationFix)@end