зеркало из https://github.com/github/Rebel.git
Merge pull request #42 from jwilling/fix-tablecellview
Modify NSTableCellView a bit.
This commit is contained in:
Коммит
65cdfe4454
|
@ -13,9 +13,12 @@
|
|||
// Useful to clear properties and bindings before reuse.
|
||||
@interface RBLTableCellView : NSTableCellView
|
||||
|
||||
// Called immediately before the cell view is going to be added
|
||||
// to a new table row view. At the time this is called, the cell
|
||||
// view will not have a superview.
|
||||
|
||||
// Called when the cell view has either been removed from
|
||||
// its superview (the row view), or has just been created.
|
||||
//
|
||||
// Either way, the cell will not have a superview during this
|
||||
// time and will be in an enqueued state.
|
||||
- (void)prepareForReuse;
|
||||
|
||||
@end
|
||||
|
|
|
@ -10,12 +10,12 @@
|
|||
|
||||
@implementation RBLTableCellView
|
||||
|
||||
- (void)viewWillMoveToSuperview:(NSView *)newSuperview {
|
||||
[super viewWillMoveToSuperview:newSuperview];
|
||||
|
||||
if (self.superview == nil && newSuperview != nil) {
|
||||
- (void)viewDidMoveToSuperview {
|
||||
if (self.superview == nil) {
|
||||
[self prepareForReuse];
|
||||
}
|
||||
|
||||
[super viewDidMoveToSuperview];
|
||||
}
|
||||
|
||||
- (void)prepareForReuse {
|
||||
|
|
|
@ -15,3 +15,4 @@
|
|||
#import <Rebel/RBLView.h>
|
||||
#import <Rebel/CAAnimation+RBLBlockAdditions.h>
|
||||
#import <Rebel/RBLPopover.h>
|
||||
#import <Rebel/RBLTableCellView.h>
|
||||
|
|
Загрузка…
Ссылка в новой задаче