Created
September 24, 2012 21:59
-
-
Save C4Code/3778707 to your computer and use it in GitHub Desktop.
Getting the time between touchesBegan and touchesEnded
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "C4WorkSpace.h" | |
@implementation C4WorkSpace { | |
NSDate *timeButtonWasPressed, *timeButtonWasReleased; | |
} | |
-(void)touchesBegan { | |
timeButtonWasPressed = [NSDate dateWithTimeIntervalSinceNow:0.0f]; | |
} | |
-(void)touchesEnded { | |
timeButtonWasReleased = [NSDate dateWithTimeIntervalSinceNow:0.0f]; | |
NSTimeInterval t = [timeButtonWasReleased timeIntervalSinceDate:timeButtonWasPressed]; | |
C4Log(@"%f",t); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment