Is there a way to determine if the iphone lying on the table rotates face up ?. I really understand that this type of movement is not reported by the accelerometer, nor does it report the interface of the (BOOL) toAutorotateToInterfaceOrientation: (UIInterfaceOrientation) method.
Is there a way to detect angle changes for a phone spinning this way ?. Thank.
The gravity vector will be constant when it rotates on a flat table, so you will not see anything on the accelerometers. You can follow compass changes to detect this rotation, but only on iPhone 3G S. For more details see CLLocationManager , see the header methods.
EDIT . With iPhone 4, you can detect rotation using gyroscopes. In iOS 4, there is a new CMMotionManager class for getting rotation speed from gyroscopes.
When the phone is stationary, the sum of the acceleration vectors must be +1. When the phone rotates (provided that the sensor is offset from the center), the sum of the vectors should be greater than 1 and (hopefully) somewhat constant.
, , , , .
AccelerometerGraph Apple.
, , iPhone . , .
, , 2g itouch, x y ( 2g , ). , , , . , , . shouldAutorotateToInterfaceOrientation, sdk , , .
Source: https://habr.com/ru/post/1737248/More articles:Abort slow stream to disk after burning? - pythonUser Controls VB.Net - .netjQuery UI Dialog and gif + text display - jquery-ui-dialoglink_to syntax with rails3 (link_to_remote) and basic javascript not working in rails3 application? - javascripthow to serialize DataTable for json or xml - c #Is there a way to tell .NET where to look for a user settings file? - .netAccess Denied error while trying to delete ClearCase.mkelem file - clearcaseВызов метода объекта С# из IronPython - c#Recommendations for developing a WPF application without using MVVM or similar - wpfDoes Java Spring 3.0 MVC support client-side support based on annotation / attribute like Asp.net MVC 2.0? - javaAll Articles