mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Add rs_enclosingTableView method as NSView category.
This commit is contained in:
@@ -27,5 +27,6 @@
|
||||
|
||||
- (NSRect)rs_rectCentered:(NSRect)originalRect;
|
||||
|
||||
- (NSTableView *)rs_enclosingTableView;
|
||||
|
||||
@end
|
||||
|
||||
@@ -65,4 +65,18 @@
|
||||
}
|
||||
|
||||
|
||||
- (NSTableView *)rs_enclosingTableView {
|
||||
|
||||
NSView *nomad = self.superview;
|
||||
|
||||
while (nomad != nil) {
|
||||
if ([nomad isKindOfClass:[NSTableView class]]) {
|
||||
return nomad;
|
||||
}
|
||||
nomad = nomad.superview;
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user