Created
August 12, 2014 13:57
-
-
Save wangyangkobe/56f868b6f831675337ec to your computer and use it in GitHub Desktop.
根据UITableViewCell的元素来获取UITableViewCell.(兼容ios7和ios6).
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
@implementation UIView (KLCPopupExample) | |
- (UITableViewCell*)parentCell { | |
// Iterate over superviews until you find a UITableViewCell | |
UIView* view = self; | |
while (view != nil) { | |
if ([view isKindOfClass:[UITableViewCell class]]) { | |
return (UITableViewCell*)view; | |
} else { | |
view = [view superview]; | |
} | |
} | |
return nil; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment