previousLocationInView:
前回のタッチの位置を取得します。
-(CGPoint)previousLocationInView:(UIView *)view
解説
返り値
( CGPoint )
引数
( UIView * )view
フレームワーク
UIKit
クラス
UITouch
Instance Methods
使用可能
iPhone2.0
参照
例文
- (void) touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event { UITouch* touch = [touches anyObject]; CGPoint prePoint = [touch previousLocationInView:self]; CGPoint aPoint = [touch locationInView:self]; NSLog(@"x = %f ,x = %f , y = %f, y = %f",aPoint.x,prePoint.x,aPoint.y,prePoint.y); NSLog(@"Δx = %f , Δy = %f",aPoint.x-prePoint.x,aPoint.y-prePoint.y); [self setNeedsDisplay]; }