2012-09-04 175 views
0

我有一個像輪盤賭一樣的菜單,它像一個輪子一樣旋轉。 捕捉我使用的事件touch began/move在屏幕上捕捉加速事件

我如何添加它acceleration?我想註冊一個acceleration事件,當用戶觸摸一個項目並滑動?

回答

0

This might help

Listing 4-4 Receiving an accelerometer event 
- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration 
{ 
UIAccelerationValue x, y, z; 
x = acceleration.x; 
y = acceleration.y; 
z = acceleration.z; 

// Do something with the values. 
} 
+0

如何從這個代碼知道加速度的數值的大小?所以檢查它是否更大\從價值更小? – vadim

+0

http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIAcceleration_Class/Reference/UIAcceleration.html#//apple_ref/doc/uid/TP40006901 – prashant

+0

也許我寫錯了...我需要紡車的角加速度,紡紗的「動力」,這個代碼事件能幫助我嗎? – vadim