I need to detect which direction the iPhone is facing so I can record from the non obstructed camera (Front or Back) when dropped.
This will be used in emergency situation and the phone is dropped, or placed in such a way that the active camera is recording nothing of value.
What API or technique can I use to determine this?
Use the Core Motion accelerometer. It reports the direction of gravity, which tells you which way the device is facing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With