Previously, I worked really hard to get the "auto-rotate" animation to look nice and native on the old iPhone, and then Apple changed the SDK yet one more bloody time and I totally gave up. Now all I do is simply wrap the entire scene in glRotate to match the orientation, but I don't bother with any rotation effects.

Another thing I do is I have the scene so that 0,0 is always at the center of the screen (as opposed to being 0,0 in the lower left-hand corner or something). That way it is much easier to do object placement for different sized screens and orientations -- at least as far as I've been able to come up with. It also helps for translating touch coordinates.

For the touch coordinates, I always convert them to what I call "gameSpace" coordinates as I receive them. It's pretty simple to swap x and y for touch coordinates and flip y if necessary.

One thing that I do when trying to figure out touch coordinates and making sure they're lined up with the orientation and make sense, is I make a habit of printf-ing them out to make sure they aren't whacky. Guessing or assuming the coordinates are correct can cost a lot of time.

Finally, dealing with multiple orientations, at least from my experience, can be an extreme pain in the butt and can really bloat the code. I don't know of any easy way around it though.

After much searching around the internet (Google is all very well just as long as you know what to search for!) and playing around with my code I've finally got the rotation working.

When I have some time I intend to write up exactly what I did to resolve it to help anyone else who runs into the same problems as I did. I'm not sure if my solution is the official way of doing but it works so that is all that concerns me for now.

However I must add that just as I thought I had got it all working fine and tested in the simulator it started failing on the actual device seemingly randomly. It was then I realised that it was going wrong when the device was flat. The simulator has no option to put the device into UIDeviceOrientationFaceUp or UIDeviceOrientationFaceDown positions.

Someone reported a strange issue of the played cards disappearing when the device was rotated.

After some investigation I managed to reproduce it - a problem caused by the cards being moved to the last touched position when the screen itself was touched during rotation.

What amazes is me is that this was never seen during all the testing. Several people who had never even used an iPad before tried it but this is the only case so far where someone is actually holding the device by the screen instead of the frame during rotation.

Just goes to show that no matter how much testing you do there are still users out there with the ability to break your app by doing the unexpected.