I want to keep support for both landscape and portrait orientation in General – > iphone orientation. However, when the app runs, I am making a start up call and based on a flag in the response , I want to disable landscape orientation or keep it throughout the app.
How can I programatically enable or disable landscape orientation?
2
Answers
In your view controller try overriding these properties like below:
You may refer this apple documentation
As the requirement is to lock the application orientation based on the api response you can programatically handle it in the application delegate method