1

Information:
Hardware lock on (via lock center)
App only supports portrait

Reason: Adjusting orientation of images captured using AVCapture i.e. when taking a picture in landscape, adjust it so it is shown portrait when displaying it. AVCapture is set to portrait (if set otherwise, the actual camera layer will rotate which is not intended).

If hardware lock is on (via control center), UIDeviceOrientation AND UIInterfaceOrientation always return portrait.

Is there a way (besides using the Accelerometer) to detect device orientation / tilt, without regarding the lock?

B-Man
  • 2,209
  • 3
  • 22
  • 35
  • Seems like accelerometer is your only option. Have you seen this question: http://stackoverflow.com/questions/4574693/ios-device-orientation-disregarding-orientation-lock? Looks like it's not that hard to pull off. – Aaron Jul 16 '14 at 17:57
  • Yeah I have, and i implemented it and it is working fine. I do believe that they should have made a simpler method than having to access the accelerometer. And even that is deprecated, so have to start the whole CoreMotion train to get the same result, which is not pretty for an app that dont need all that machinery. There has to be an easier way... Thanks for your comment though! – B-Man Jul 16 '14 at 20:37
  • can you share what you did @B-Man ? – chipbk10 Mar 02 '17 at 07:56

1 Answers1

0

I don't believe you can detect if hardware lock is on or not.

Brad Moore
  • 316
  • 5
  • 23
  • I am looking for a way to detect orientation of device whether i know if the hardware lock is on or not... so i am not looking to detect if the lock is on or not at all, it should not matter in the solution i am looking for :) – B-Man Jul 16 '14 at 14:38
  • 2
    Just checking where I got negative rep from, I can see now why. I deserved this. – Brad Moore Oct 24 '16 at 22:41