IOS 屏幕手指滑动点追踪

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent*)event {

UITouch*pTouch = touches.anyObject;

//self.view

CGPointposition = [pTouchlocationInView:self.view];

//self.myView

CGPointposition2 = [pTouchlocationInView:self.myView];

NSLog(@"开始1 %@",NSStringFromCGPoint(position));

NSLog(@"开始2 %@",NSStringFromCGPoint(position2));

}

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent*)event {

UITouch*pTouch = touches.anyObject;

CGPointposition = [pTouchlocationInView:self.view];

NSLog(@"移动%@",NSStringFromCGPoint(position));

}

-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent*)event {

UITouch*pTouch = touches.anyObject;

CGPointposition = [pTouchlocationInView:self.view];

NSLog(@"抬起%@",NSStringFromCGPoint(position));

}

你可能感兴趣的:(IOS 屏幕手指滑动点追踪)