Reputation: 3854
I have an iPhone 4 and I would like to detect whether the phone is vertically straight (see first image) or horizontal (see second image). I am not talking about portrait vs landscape view detection.
I am new to iOS development and I think what I am looking for is the accelerometer (specifically the pitch property perhaps) or gyroscope. I have looked online and I am not quite understanding the code or whether I am looking for the right properties. Can someone please tell me how this can be done?
Thank you!
Upvotes: 0
Views: 832
Reputation: 355
Try the accelerometer
api and check the position of the phone.
here is a tutorial: http://tech.pro/tutorial/968/iphone-tutorial-reading-the-accelerometer
Upvotes: 1