IOS 触屏检测实例

来源:互联网 发布:软件开发mpp 编辑:程序博客网 时间:2024/05/29 03:08

作者:朱克锋

邮箱:zhukefeng@iboxpay.com

转载请注明出处:http://blog.csdn.net/linux_zkf

- (void)updateLabelsFromTouches:(NSSet *)touches {

    NSUInteger numTaps = [[touchesanyObject] tapCount];

       NSUInteger numTouches = [touchescount];

    NSLog(@"numTaps :%i, numTouches :%i",numTaps,numTouches);

}

#pragma mark -

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

    [selfupdateLabelsFromTouches:touches];

}

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

    [selfupdateLabelsFromTouches:touches];

}

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

    [selfupdateLabelsFromTouches:touches];

}

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

    [selfupdateLabelsFromTouches:touches];

}



原创粉丝点击