Rename ASCellNode delegate to layoutDelegate to avoid common naming overlap

This commit is contained in:
Scott Goodson
2015-11-01 12:51:46 -08:00
parent 0598935957
commit e517f88e65
4 changed files with 8 additions and 8 deletions

View File

@@ -12,7 +12,7 @@
typedef NSUInteger ASCellNodeAnimation; typedef NSUInteger ASCellNodeAnimation;
@protocol ASCellNodeDelegate <NSObject> @protocol ASCellNodeLayoutDelegate <NSObject>
/** /**
* Notifies the delegate that the specified cell node has done a relayout. * Notifies the delegate that the specified cell node has done a relayout.
@@ -72,7 +72,7 @@ typedef NSUInteger ASCellNodeAnimation;
/* /*
* A delegate to be notified (on main thread) after a relayout. * 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. * A constant that is passed to the delegate to indicate how a relayout is to be animated.

View File

@@ -56,9 +56,9 @@
ASDisplayNodeAssertThreadAffinity(self); ASDisplayNodeAssertThreadAffinity(self);
[super setNeedsLayout]; [super setNeedsLayout];
if (_delegate != nil) { if (_layoutDelegate != nil) {
ASPerformBlockOnMainThread(^{ ASPerformBlockOnMainThread(^{
[_delegate node:self didRelayoutWithSuggestedAnimation:_relayoutAnimation]; [_layoutDelegate node:self didRelayoutWithSuggestedAnimation:_relayoutAnimation];
}); });
} }
} }

View File

@@ -130,7 +130,7 @@ static BOOL _isInterceptedSelector(SEL sel)
#pragma mark - #pragma mark -
#pragma mark ASCollectionView. #pragma mark ASCollectionView.
@interface ASCollectionView () <ASRangeControllerDelegate, ASDataControllerSource, ASCellNodeDelegate> { @interface ASCollectionView () <ASRangeControllerDelegate, ASDataControllerSource, ASCellNodeLayoutDelegate> {
_ASCollectionViewProxy *_proxyDataSource; _ASCollectionViewProxy *_proxyDataSource;
_ASCollectionViewProxy *_proxyDelegate; _ASCollectionViewProxy *_proxyDelegate;
@@ -655,7 +655,7 @@ static BOOL _isInterceptedSelector(SEL sel)
{ {
ASCellNode *node = [_asyncDataSource collectionView:self nodeForItemAtIndexPath:indexPath]; ASCellNode *node = [_asyncDataSource collectionView:self nodeForItemAtIndexPath:indexPath];
ASDisplayNodeAssert([node isKindOfClass:ASCellNode.class], @"invalid node class, expected ASCellNode"); ASDisplayNodeAssert([node isKindOfClass:ASCellNode.class], @"invalid node class, expected ASCellNode");
node.delegate = self; node.layoutDelegate = self;
return node; return node;
} }

View File

@@ -151,7 +151,7 @@ static BOOL _isInterceptedSelector(SEL sel)
#pragma mark - #pragma mark -
#pragma mark ASTableView #pragma mark ASTableView
@interface ASTableView () <ASRangeControllerDelegate, ASDataControllerSource, _ASTableViewCellDelegate, ASCellNodeDelegate> { @interface ASTableView () <ASRangeControllerDelegate, ASDataControllerSource, _ASTableViewCellDelegate, ASCellNodeLayoutDelegate> {
_ASTableViewProxy *_proxyDataSource; _ASTableViewProxy *_proxyDataSource;
_ASTableViewProxy *_proxyDelegate; _ASTableViewProxy *_proxyDelegate;
@@ -820,7 +820,7 @@ static BOOL _isInterceptedSelector(SEL sel)
{ {
ASCellNode *node = [_asyncDataSource tableView:self nodeForRowAtIndexPath:indexPath]; ASCellNode *node = [_asyncDataSource tableView:self nodeForRowAtIndexPath:indexPath];
ASDisplayNodeAssert([node isKindOfClass:ASCellNode.class], @"invalid node class, expected ASCellNode"); ASDisplayNodeAssert([node isKindOfClass:ASCellNode.class], @"invalid node class, expected ASCellNode");
node.delegate = self; node.layoutDelegate = self;
return node; return node;
} }