Skip to content

Instantly share code, notes, and snippets.

@cobysy
Last active August 29, 2015 14:02
Show Gist options
  • Save cobysy/38de471bde9fafbf7eef to your computer and use it in GitHub Desktop.
Save cobysy/38de471bde9fafbf7eef to your computer and use it in GitHub Desktop.
Allow controls in a UITableViewCell to immediately react to touches in iOS 7 (credit: http://stackoverflow.com/questions/19256996/uibutton-not-showing-highlight-on-tap-in-ios7)
- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
{
UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
for (id obj in cell.subviews) {
if ([NSStringFromClass([obj class]) isEqualToString:@"UITableViewCellScrollView"]) {
UIScrollView* scroll = (UIScrollView*)obj;
scroll.delaysContentTouches = NO;
break;
}
}
// Configure the cell...
return cell;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment