Last active
August 29, 2015 13:57
-
-
Save brennanMKE/9730988 to your computer and use it in GitHub Desktop.
indexPathForView:inTableView:
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
- (NSIndexPath *)indexPathForView:(UIView *)view inTableView:(UITableView *)tableView { | |
UIView *superview = view; | |
while (superview && ![superview isKindOfClass:[UITableViewCell class]]) { | |
superview = superview.superview; | |
} | |
if ([superview isKindOfClass:[UITableViewCell class]]) { | |
NSIndexPath *indexPath = [tableView indexPathForCell:(UITableViewCell *)superview]; | |
return indexPath; | |
} | |
return nil; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment