Skip to content

Instantly share code, notes, and snippets.

@kristopherjohnson
Created March 8, 2014 17:47
Show Gist options
  • Save kristopherjohnson/9435779 to your computer and use it in GitHub Desktop.
Save kristopherjohnson/9435779 to your computer and use it in GitHub Desktop.
Hack to 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)
- (void)fixDelaysContentTouches:(UITableViewCell *)cell {
// Hack to allow buttons to show highlight state immediately on touch
// See http://stackoverflow.com/questions/19256996/uibutton-not-showing-highlight-on-tap-in-ios7
for (id obj in cell.subviews) {
if ([NSStringFromClass([obj class]) isEqualToString:@"UITableViewCellScrollView"]) {
UIScrollView *scroll = (UIScrollView *) obj;
scroll.delaysContentTouches = NO;
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment