美文网首页移动开发
IOS 屏幕手指滑动点追踪

IOS 屏幕手指滑动点追踪

作者: JakieZhang | 来源:发表于2016-12-21 12:56 被阅读183次

    -(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 屏幕手指滑动点追踪

        本文链接:https://www.haomeiwen.com/subject/vhdqvttx.html