Last active
August 29, 2015 14:02
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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