You could use the window.orientation property (output will be in degrees), since it is supported in Safari for IOS
Note: Its use is depreciated and is not supported in many of the other browsers, fore other browsers you should use the screen.orientation property or the Generic Sensors API