2014-12-11

Practice Final Question 8 (iOS).

-(void) touchesBegan (NSSet *)touches withEvent: (UIEvent *)event{
    UITouch *touch = [touches anyObject];
    NSUInteger tapCount = [touch tapCount];
    if(tapCount < 3){
      NSLog(@"that is not a triple tap!");
      [self.nextResponder touchesBegan:touches withEvent:event];
    }
    if(tapCount == 3){
      [NSObject cancelPreviousPerformRequestsWithTarget:self];
      [self performSelector: @selector(tripleTap) withObject: nil  afterDelay: 0.4];
    }
    if(tapCount > 3){
      NSLog(@"that is more a triple tap!");
      [NSObject cancelPreviousPerformRequestsWithTarget:self];
    } 
} -(void)tripleTap{
    label.text = @"triple tap detected";
}
-(void) touchesBegan (NSSet *)touches withEvent: (UIEvent *)event{ UITouch *touch = [touches anyObject]; NSUInteger tapCount = [touch tapCount]; if(tapCount < 3){ NSLog(@"that is not a triple tap!"); [self.nextResponder touchesBegan:touches withEvent:event]; } if(tapCount == 3){ [NSObject cancelPreviousPerformRequestsWithTarget:self]; [self performSelector: @selector(tripleTap) withObject: nil afterDelay: 0.4]; } if(tapCount > 3){ NSLog(@"that is more a triple tap!"); [NSObject cancelPreviousPerformRequestsWithTarget:self]; } } -(void)tripleTap{ label.text = @"triple tap detected"; }

-- Practice Final Question 8 (iOS)
Members: Sreenidhi Pundi Muralidharan, Kenan Ozdamar
Members: Sreenidhi Pundi Muralidharan, Kenan Ozdamar
X