I have an application which has a Tab Bar Controller with two items in it. Each item has its own Navigation Controller. Each part of the application has different behaviors. So I am not able to control the device orientation app-wide. However, in the second part of the app, I mean in the second navigation controller, the behavior should be slightly different.
I have a parent view controller in the second navigation controller. It should be always portrait. So I have made it using a lock method from the answer: https://stackoverflow.com/a/41811798/2152616
Basically, I call lock methods and it works fine. It also pushes to another view controller on some user action. The second view controller does not need to support landscape. So I am able to use the same technique to lock the orientation to portrait. However, when user rotate the device to landscape the I should present another view controller. In the case I lock the orientation, I'm not able to detect the orientation change.
How can I detect the orientation while the view controller supports only portrait mode?