In your method, touchesBegan:withEvent:create an NSDate object and save it in an instance variable. (For purposes without debugging, create one date with one touch and use CFMutableDictionary to bind the date with a touch.) Then touchesEnded:withEvent:find the saved date and create a new date and send the last message to timeIntervalSinceDate:subtract the older date from it, giving the result in seconds.
source
share