Reputation: 1878
Is it possible to allow both orientations for third party framework? Suppose I am using "XYZ" third party framework in my app. I don't have access to its source code. This framework needs landscape orientation to be allowed by application for some functionality. But my application only supports portrait mode. So I want allow landscape mode only to "XYZ" framework. Is there any way to do this?
As per my understanding, to solve this problem we can allow both orientations to app and in each viewcontroller we can block landscape orientation.But I don't think this is good solution if application is having 20-30 view controllers.
Upvotes: 2
Views: 331
Reputation: 4047
In order for some of your view controllers to support multiple orientations, theses orientation should be allowed for the entire app. That means that the solution you described is the way to go (limiting the orientation changes on most of the view controllers in the app). However, you don't have to add manual treatment to each view controller. You can subclass UIViewController, add treatment for only supporting a single orientation even though the containing app supports multiple orientations, and have all of your other view controllers inherit from this new UIViewController subclass instead of directly from UIViewController.
I hope this helps. Good luck.
Upvotes: 1