Are you saying you have to fight gimbal lock just to find which way to rotate the screen on iPhone? That was a problem on the 1960s lunar missions, no idea it'd happen in such a mundane application
This is why orientation should always be reported as a unit quaternion (or if you strongly care about using only 3 vs. 4 numbers, using "modified Rodrigues parameters", the stereographic projection of a unit quaternion).
Pretty much. The iPhone browser api only exposes compass data in one dimension, around the z-axis. So there is indeed gimbal lock-like behavior near the axis. Which is crazy since the magnetometer is 3 dimensional.