// TapDetectingImageView.m
// Code omitted, as this is provided as sample code via the iPhone Developer Portal and covered under the NDA.
// You can find a copy of the class here: http://developer.apple.com/iphone/library/samplecode/ScrollViewSuite/listing15.html

// TapDetectingTableView.m
// EGOScrollView.m
// Reworked the example code from Apple above, to work with UITableViews and UIScrollViews too
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
	[super touchesEnded:touches withEvent:event];
	
	UITouch* touch = [touches anyObject];
	tapLocation = [touch locationInView:self];
	
	if([touch tapCount] == 1) {
		[self performSelector:@selector(handleSingleTap) withObject:nil afterDelay:DOUBLE_TAP_DELAY];
	} else if(touch.tapCount == 2) {
		[(id<TapDetectingTableViewDelegate>)self.delegate tapDetectingTableViewGotDoubleTap:self];
	}
}

// PostsTableViewController.m
// ShuffleViewController.m (Same function in both classes)
- (void)photoSelected:(EGOImageButton*)button event:(UIEvent*)event {
	UITouch* touch = [[event allTouches] anyObject];
	NSIndexPath* indexPath = [self.tableView indexPathForRowAtPoint:[touch locationInView:self.tableView]];
	PhotosCell* cell = (PhotosCell*)[self.tableView cellForRowAtIndexPath:indexPath];
	// Rest of the code omitted, not relevant since we only use the Touch to find the correct cell
}

// TCCommentsTableController.m
// Same code is also used in the following methods:
//
// [TCCommentsTableController addReply:event:]
// [TCCommentsTableController pushProfile:event:]
// [TCCommentsTableController pushImage:event:]
// [TCCommentsTableController pushReplies:event:]

- (IBAction)pushReplies:(UIButton*)button event:(UIEvent*)event {
	UITouch* touch = [[event allTouches] anyObject];
	NSIndexPath* indexPath = [self.tableView indexPathForRowAtPoint:[touch locationInView:self.tableView]];
	// Rest of the code omitted, not relevant since we only use the Touch to find the correct row
}
