IOS 触屏检测实例

作者:朱克锋

邮箱:[email protected]

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

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

    NSUInteger numTaps = [[touches anyObject] tapCount];

       NSUInteger numTouches = [touches count];

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

}

#pragma mark -

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

    [self updateLabelsFromTouches:touches];

}

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

    [self updateLabelsFromTouches:touches];

}

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

    [self updateLabelsFromTouches:touches];

}

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

    [self updateLabelsFromTouches:touches];

}



你可能感兴趣的:(ios)