Created
March 8, 2014 17:47
-
-
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)
This file contains hidden or 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
- (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