I have one viewcontroller in application that supports landscape and portrait orientations.
On a button click, a popup appears where I should enter the name. everything works as it should on portrait mode.
But if I dismiss the keyboard, rotate the device left or right and then open the popup, keyboard still opens in portrait mode.
I've shouldAutorotate returning true and supportedInterfaceOrientations returning AllButUpsideDown in viewcontroller, so rotation happens automatically.
I tried this and this options but none of them work.
Any ideas what to do?

