I was googling for this info and everyone has a version to do it in XCode, but it seems Apple likes to deprecate methods every iOS version... GRRR Damn apple
It is possible to lock the orientation. However the orientation doesn't change automatically. I tried all the solutions that I was able to found and non worked reliably (or looked safe enough to use).