Detecting device orientation change on iOS

How to detect when a device (iPhone or iPad) changes orientation?

http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.html shows various overridable functions such as OnMouseEnter. It’d be great if there is something like OnDeviceChange().

Thanks in advance for your help.

There’s Input.deviceOrientation

Consider this forum post …

DeviceChange.OnOrientationChange

Scroll down to Doug.McFarlane

DeviceChange.OnOrientationChange += MyOrientationChangeCode;
void MyOrientationChangeCode(DeviceOrientation orientation) {}