Page 1 of 1

iOS orientation initiation unknown

Posted: Thu Mar 06, 2014 3:00 am
by bakuraace
Trying to learn some iOS specific stuff with mobile apps.

I have created a simple app to help me debug and understand what is happening behind the code. So far I have a stack that waits for a message orientationChanged to update the stack when the user rotates his/her device.

However I am struggling due to the fact that the simulator (haven't tried on a device yet) doesn't seem to be able to recognize the orientation before the app gets going. It would be cleaner I think to have the app orientation predetermined by the current orientation of the users device... All I get right now is a declaration of "unknown" instead of "landscape left" for example. Only happens when app is first started up.

Any help is appreciated. :-)

Re: iOS orientation initiation unknown

Posted: Sat Mar 08, 2014 3:25 pm
by Mark
Hi,

I ran into the same problem and I decided to write a blog post about my solution. It has become a brief tutorial. You can read it here.

Kind regards,

Mark

Re: iOS orientation initiation unknown

Posted: Sun Mar 09, 2014 4:47 am
by bakuraace
I will give the acceleration functionality a try when I can... Hope that it does the trick... I've kept trying to keep the unknown response for orientation from causing problems by using conditional statements and making assumptions but even that isn't working out for me.

Re: iOS orientation initiation unknown

Posted: Sun Mar 09, 2014 12:34 pm
by Mark
Hi,

Reading your question again, I understand that you want to know the current orientation rather than the change from the previous orientation. My tutorial is about changing the position of the device rather than it's current position.

Perhaps your problem is in the simulator. Have you tried this on a real device already?

Kind regards,

Mark