Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Merge pull request #806 from facebook/CellDelegateNaming
Browse files Browse the repository at this point in the history
Rename ASCellNode delegate to layoutDelegate to avoid common naming conflict
  • Loading branch information
appleguy committed Nov 1, 2015
2 parents 0598935 + e517f88 commit 7b112a2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions AsyncDisplayKit/ASCellNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

typedef NSUInteger ASCellNodeAnimation;

@protocol ASCellNodeDelegate <NSObject>
@protocol ASCellNodeLayoutDelegate <NSObject>

/**
* Notifies the delegate that the specified cell node has done a relayout.
Expand Down Expand Up @@ -72,7 +72,7 @@ typedef NSUInteger ASCellNodeAnimation;
/*
* A delegate to be notified (on main thread) after a relayout.
*/
@property (nonatomic, weak) id<ASCellNodeDelegate> delegate;
@property (nonatomic, weak) id<ASCellNodeLayoutDelegate> layoutDelegate;

/*
* A constant that is passed to the delegate to indicate how a relayout is to be animated.
Expand Down
4 changes: 2 additions & 2 deletions AsyncDisplayKit/ASCellNode.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ - (void)setNeedsLayout
ASDisplayNodeAssertThreadAffinity(self);
[super setNeedsLayout];

if (_delegate != nil) {
if (_layoutDelegate != nil) {
ASPerformBlockOnMainThread(^{
[_delegate node:self didRelayoutWithSuggestedAnimation:_relayoutAnimation];
[_layoutDelegate node:self didRelayoutWithSuggestedAnimation:_relayoutAnimation];
});
}
}
Expand Down
4 changes: 2 additions & 2 deletions AsyncDisplayKit/ASCollectionView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ - (void)setHighlighted:(BOOL)highlighted
#pragma mark -
#pragma mark ASCollectionView.

@interface ASCollectionView () <ASRangeControllerDelegate, ASDataControllerSource, ASCellNodeDelegate> {
@interface ASCollectionView () <ASRangeControllerDelegate, ASDataControllerSource, ASCellNodeLayoutDelegate> {
_ASCollectionViewProxy *_proxyDataSource;
_ASCollectionViewProxy *_proxyDelegate;

Expand Down Expand Up @@ -655,7 +655,7 @@ - (ASCellNode *)dataController:(ASDataController *)dataController nodeAtIndexPat
{
ASCellNode *node = [_asyncDataSource collectionView:self nodeForItemAtIndexPath:indexPath];
ASDisplayNodeAssert([node isKindOfClass:ASCellNode.class], @"invalid node class, expected ASCellNode");
node.delegate = self;
node.layoutDelegate = self;
return node;
}

Expand Down
4 changes: 2 additions & 2 deletions AsyncDisplayKit/ASTableView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ - (void)setHighlighted:(BOOL)highlighted
#pragma mark -
#pragma mark ASTableView

@interface ASTableView () <ASRangeControllerDelegate, ASDataControllerSource, _ASTableViewCellDelegate, ASCellNodeDelegate> {
@interface ASTableView () <ASRangeControllerDelegate, ASDataControllerSource, _ASTableViewCellDelegate, ASCellNodeLayoutDelegate> {
_ASTableViewProxy *_proxyDataSource;
_ASTableViewProxy *_proxyDelegate;

Expand Down Expand Up @@ -820,7 +820,7 @@ - (ASCellNode *)dataController:(ASDataController *)dataController nodeAtIndexPat
{
ASCellNode *node = [_asyncDataSource tableView:self nodeForRowAtIndexPath:indexPath];
ASDisplayNodeAssert([node isKindOfClass:ASCellNode.class], @"invalid node class, expected ASCellNode");
node.delegate = self;
node.layoutDelegate = self;
return node;
}

Expand Down

0 comments on commit 7b112a2

Please sign in to comment.