Skip to content

Instantly share code, notes, and snippets.

@MosheBerman
Created April 15, 2013 04:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MosheBerman/5385650 to your computer and use it in GitHub Desktop.
Save MosheBerman/5385650 to your computer and use it in GitHub Desktop.
Calendar Touch handling
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event
{
if ([[self headerView] pointInside:point withEvent:event])
{
return YES;
}
else if([[self table] pointInside:point withEvent:event])
{
return YES;
}
/* Highlight and select the appropriate cell */
NSUInteger index = [self selectedIndex];
for (CKCakeCell *cell in [self usedCells]) {
CGRect rect = [cell frame];
if (CGRectContainsPoint(rect, point)) {
[cell setSelected];
index = [cell index];
}
else
{
[cell setDeselected];
}
}
[self setSelectedIndex:index];
return [super pointInside:point withEvent:event];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment