Changed the way to get the device orientation in the Viewcontroller.m