Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Cell Node Properties Atomic #74

Merged
merged 8 commits into from
May 2, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions AsyncDisplayKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
CCA282D01E9EBF6C0037E8B7 /* ASTipsWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = CCA282CE1E9EBF6C0037E8B7 /* ASTipsWindow.h */; };
CCA282D11E9EBF6C0037E8B7 /* ASTipsWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = CCA282CF1E9EBF6C0037E8B7 /* ASTipsWindow.m */; };
CCB2F34D1D63CCC6004E6DE9 /* ASDisplayNodeSnapshotTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CCB2F34C1D63CCC6004E6DE9 /* ASDisplayNodeSnapshotTests.m */; };
CCBBBF5D1EB161760069AA91 /* ASRangeManagedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = CCBBBF5C1EB161760069AA91 /* ASRangeManagedNode.h */; settings = {ATTRIBUTES = (Public, ); }; };
CCF18FF41D2575E300DF5895 /* NSIndexSet+ASHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = CC4981BA1D1C7F65004E13CC /* NSIndexSet+ASHelpers.h */; settings = {ATTRIBUTES = (Private, ); }; };
DB55C2671C641AE4004EDCF5 /* ASContextTransitioning.h in Headers */ = {isa = PBXBuildFile; fileRef = DB55C2651C641AE4004EDCF5 /* ASContextTransitioning.h */; settings = {ATTRIBUTES = (Public, ); }; };
DB7121BCD50849C498C886FB /* libPods-AsyncDisplayKitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EFA731F0396842FF8AB635EE /* libPods-AsyncDisplayKitTests.a */; };
Expand Down Expand Up @@ -798,6 +799,7 @@
CCA282CE1E9EBF6C0037E8B7 /* ASTipsWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASTipsWindow.h; sourceTree = "<group>"; };
CCA282CF1E9EBF6C0037E8B7 /* ASTipsWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASTipsWindow.m; sourceTree = "<group>"; };
CCB2F34C1D63CCC6004E6DE9 /* ASDisplayNodeSnapshotTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASDisplayNodeSnapshotTests.m; sourceTree = "<group>"; };
CCBBBF5C1EB161760069AA91 /* ASRangeManagedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASRangeManagedNode.h; sourceTree = "<group>"; };
CCBD05DE1E4147B000D18509 /* ASIGListAdapterBasedDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASIGListAdapterBasedDataSource.m; sourceTree = "<group>"; };
CCBD05DF1E4147B000D18509 /* ASIGListAdapterBasedDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIGListAdapterBasedDataSource.h; sourceTree = "<group>"; };
CCE04B1E1E313EA7006AEBBB /* ASSectionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASSectionController.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1002,6 +1004,7 @@
25E327551C16819500A2170C /* ASPagerNode.m */,
A2763D771CBDD57D00A9ADBD /* ASPINRemoteImageDownloader.h */,
A2763D781CBDD57D00A9ADBD /* ASPINRemoteImageDownloader.m */,
CCBBBF5C1EB161760069AA91 /* ASRangeManagedNode.h */,
ACE87A2B1D73696800D7FF06 /* ASSectionContext.h */,
D785F6601A74327E00291744 /* ASScrollNode.h */,
D785F6611A74327E00291744 /* ASScrollNode.mm */,
Expand Down Expand Up @@ -1533,6 +1536,7 @@
509E68611B3AEDA0009B9150 /* ASAbstractLayoutController.h in Headers */,
CCA282B81E9EA8E40037E8B7 /* AsyncDisplayKit+Tips.h in Headers */,
B35062571B010F070018CF92 /* ASAssert.h in Headers */,
CCBBBF5D1EB161760069AA91 /* ASRangeManagedNode.h in Headers */,
B35062581B010F070018CF92 /* ASAvailability.h in Headers */,
DE84918D1C8FFF2B003D89E9 /* ASRunLoopQueue.h in Headers */,
CC0F88621E4281E200576FED /* ASSectionController.h in Headers */,
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
- Add support for IGListKit post-removal-of-IGListSectionType, in preparation for IGListKit 3.0.0 release. (Adlai-Holler)[https://github.com/Adlai-Holler] (#49)[https://github.com/TextureGroup/Texture/pull/49]
- Fix `__has_include` check in ASLog.h [Philipp Smorygo]([email protected])
- Fix potential deadlock in ASControlNode [Garrett Moon](https://github.com/garrettmoon)
- Make cell node `indexPath` and `supplementaryElementKind` atomic so you can read from any thread. (Adlai-Holler)[https://github.com/Adlai-Holler] (#49)[https://github.com/TextureGroup/Texture/pull/74]
12 changes: 5 additions & 7 deletions Source/ASCellNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
NS_ASSUME_NONNULL_BEGIN

@class ASCellNode, ASTextNode;
@protocol ASRangeManagedNode;

typedef NSUInteger ASCellNodeAnimation;

Expand Down Expand Up @@ -87,7 +88,7 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) {
* @return The supplementary element kind, or @c nil if this node does not represent a supplementary element.
*/
//TODO change this to be a generic "kind" or "elementKind" that exposes `nil` for row kind
@property (nonatomic, copy, readonly, nullable) NSString *supplementaryElementKind;
@property (copy, readonly, nullable) NSString *supplementaryElementKind;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it is implied, but stylistically, I think it would be a good idea to require atomic to be stated explicitly for properties that intend it. Although it might become the more common thing, currently it's uncommon enough that most cases where it is omitted could be confused for mistakes. Any thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm down with it. The explicitness is nice.


/*
* The layout attributes currently assigned to this node, if any.
Expand All @@ -113,10 +114,8 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) {
/**
* The current index path of this cell node, or @c nil if this node is
* not a valid item inside a table node or collection node.
*
* @note This property must be accessed on the main thread.
*/
@property (nonatomic, readonly, nullable) NSIndexPath *indexPath;
@property (readonly, nullable) NSIndexPath *indexPath;

/**
* The backing view controller, or @c nil if the node wasn't initialized with backing view controller
Expand All @@ -126,10 +125,9 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) {


/**
* The owning node (ASCollectionNode/ASTableNode) of this cell node, or @c nil if this node is
* not a valid item inside a table node or collection node or if those nodes are nil.
* The table- or collection-node that this cell is a member of, if any.
*/
@property (weak, nonatomic, readonly, nullable) ASDisplayNode *owningNode;
@property (weak, readonly, nullable) id<ASRangeManagedNode> owningNode;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This s technically a breaking API change but it's so minor that we shouldn't worry about it. Virtually nobody uses this property – it was recently added and probably shouldn't be public anyway – and the migration pathway is trivial.


/*
* ASCellNode must forward touch events in order for UITableView and UICollectionView tap handling to work. Overriding
Expand Down
29 changes: 1 addition & 28 deletions Source/ASCellNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ @interface ASCellNode ()
ASDisplayNode *_viewControllerNode;
UIViewController *_viewController;
BOOL _suspendInteractionDelegate;

struct {
unsigned int isTableNode:1;
unsigned int isCollectionNode:1;
} _owningNodeType;

}

@end
Expand Down Expand Up @@ -165,19 +159,6 @@ - (void)setHighlighted:(BOOL)highlighted
}
}

- (void)setOwningNode:(ASDisplayNode *)owningNode
{
_owningNode = owningNode;

memset(&_owningNodeType, 0, sizeof(_owningNodeType));

if ([owningNode isKindOfClass:[ASTableNode class]]) {
_owningNodeType.isTableNode = 1;
} else if ([owningNode isKindOfClass:[ASCollectionNode class]]) {
_owningNodeType.isCollectionNode = 1;
}
}

- (void)__setSelectedFromUIKit:(BOOL)selected;
{
if (selected != _selected) {
Expand All @@ -198,15 +179,7 @@ - (void)__setHighlightedFromUIKit:(BOOL)highlighted;

- (NSIndexPath *)indexPath
{
ASDisplayNodeAssertMainThread();

if (_owningNodeType.isTableNode) {
return [(ASTableNode *)self.owningNode indexPathForNode:self];
} else if (_owningNodeType.isCollectionNode) {
return [(ASCollectionNode *)self.owningNode indexPathForNode:self];
}

return nil;
return [self.owningNode indexPathForNode:self];
}

- (UIViewController *)viewController
Expand Down
3 changes: 2 additions & 1 deletion Source/ASCollectionNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#import <AsyncDisplayKit/ASRangeControllerUpdateRangeProtocol+Beta.h>
#import <AsyncDisplayKit/ASCollectionView.h>
#import <AsyncDisplayKit/ASBlockTypes.h>
#import <AsyncDisplayKit/ASRangeManagedNode.h>

@protocol ASCollectionViewLayoutFacilitatorProtocol;
@protocol ASCollectionDelegate;
Expand All @@ -32,7 +33,7 @@ NS_ASSUME_NONNULL_BEGIN
* ASCollectionNode is a node based class that wraps an ASCollectionView. It can be used
* as a subnode of another node, and provide room for many (great) features and improvements later on.
*/
@interface ASCollectionNode : ASDisplayNode <ASRangeControllerUpdateRangeProtocol>
@interface ASCollectionNode : ASDisplayNode <ASRangeControllerUpdateRangeProtocol, ASRangeManagedNode>

- (instancetype)init NS_UNAVAILABLE;

Expand Down
2 changes: 1 addition & 1 deletion Source/ASCollectionNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ - (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionVi
__weak __typeof__(self) weakSelf = self;
[self setViewBlock:^{
__typeof__(self) strongSelf = weakSelf;
return [[[strongSelf collectionViewClass] alloc] _initWithFrame:frame collectionViewLayout:strongSelf->_pendingState.collectionViewLayout layoutFacilitator:layoutFacilitator eventLog:ASDisplayNodeGetEventLog(strongSelf)];
return [[[strongSelf collectionViewClass] alloc] _initWithFrame:frame collectionViewLayout:strongSelf->_pendingState.collectionViewLayout layoutFacilitator:layoutFacilitator owningNode:strongSelf eventLog:ASDisplayNodeGetEventLog(strongSelf)];
}];
}
return self;
Expand Down
14 changes: 4 additions & 10 deletions Source/ASCollectionView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ typedef NS_ENUM(NSUInteger, ASCollectionViewInvalidationStyle) {
#pragma mark -
#pragma mark ASCollectionView.

@interface ASCollectionView () <ASRangeControllerDataSource, ASRangeControllerDelegate, ASDataControllerSource, ASCellNodeInteractionDelegate, ASDelegateProxyInterceptor, ASBatchFetchingScrollView, ASDataControllerEnvironmentDelegate, ASCALayerExtendedDelegate, UICollectionViewDelegateFlowLayout> {
@interface ASCollectionView () <ASRangeControllerDataSource, ASRangeControllerDelegate, ASDataControllerSource, ASCellNodeInteractionDelegate, ASDelegateProxyInterceptor, ASBatchFetchingScrollView, ASCALayerExtendedDelegate, UICollectionViewDelegateFlowLayout> {
ASCollectionViewProxy *_proxyDataSource;
ASCollectionViewProxy *_proxyDelegate;

Expand Down Expand Up @@ -250,10 +250,10 @@ - (instancetype)initWithCollectionViewLayout:(UICollectionViewLayout *)layout

- (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout
{
return [self _initWithFrame:frame collectionViewLayout:layout layoutFacilitator:nil eventLog:nil];
return [self _initWithFrame:frame collectionViewLayout:layout layoutFacilitator:nil owningNode:nil eventLog:nil];
}

- (instancetype)_initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout layoutFacilitator:(id<ASCollectionViewLayoutFacilitatorProtocol>)layoutFacilitator eventLog:(ASEventLog *)eventLog
- (instancetype)_initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout layoutFacilitator:(id<ASCollectionViewLayoutFacilitatorProtocol>)layoutFacilitator owningNode:(ASCollectionNode *)owningNode eventLog:(ASEventLog *)eventLog
{
if (!(self = [super initWithFrame:frame collectionViewLayout:layout]))
return nil;
Expand All @@ -273,9 +273,8 @@ - (instancetype)_initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionV
_rangeController.delegate = self;
_rangeController.layoutController = _layoutController;

_dataController = [[ASDataController alloc] initWithDataSource:self eventLog:eventLog];
_dataController = [[ASDataController alloc] initWithDataSource:self node:owningNode eventLog:eventLog];
_dataController.delegate = _rangeController;
_dataController.environmentDelegate = self;

_batchContext = [[ASBatchContext alloc] init];

Expand Down Expand Up @@ -1649,11 +1648,6 @@ - (BOOL)dataController:(ASDataController *)dataController presentedSizeForElemen

}

- (id<ASTraitEnvironment>)dataControllerEnvironment
{
return self.collectionNode;
}

#pragma mark - ASDataControllerSource optional methods

- (ASCellNodeBlock)dataController:(ASDataController *)dataController supplementaryNodeBlockOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
Expand Down
31 changes: 31 additions & 0 deletions Source/ASRangeManagedNode.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// ASRangeManagedNode.h
// AsyncDisplayKit
//
// Created by Adlai Holler on 4/26/17.
// Copyright © 2017 Facebook. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AsyncDisplayKit/ASTraitCollection.h>

@class ASCellNode;

NS_ASSUME_NONNULL_BEGIN

/**
* Basically ASTableNode or ASCollectionNode.
*/
@protocol ASRangeManagedNode <NSObject, ASTraitEnvironment>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I'm being overly semantic, but the methods these adopt don't seem to match the name. I can imagine nodes that range manage other nodes that don't have index paths. Anyway, wondering if there's a better name but I don't have suggestions.

Also, should it be ASRangeManagingNode instead? That would better align with ASHierarchyStateRangeManaged state naming.


/**
* Retrieve the index path for the given node, if it's a member of this container.
*
* @param node The node.
* @return The index path, or nil if the node is not part of this container.
*/
- (nullable NSIndexPath *)indexPathForNode:(ASCellNode *)node;

@end

NS_ASSUME_NONNULL_END
4 changes: 2 additions & 2 deletions Source/ASTableNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#import <AsyncDisplayKit/ASDisplayNode.h>
#import <AsyncDisplayKit/ASRangeControllerUpdateRangeProtocol+Beta.h>
#import <AsyncDisplayKit/ASTableView.h>

#import <AsyncDisplayKit/ASRangeManagedNode.h>

NS_ASSUME_NONNULL_BEGIN

Expand All @@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
* ASTableNode is a node based class that wraps an ASTableView. It can be used
* as a subnode of another node, and provide room for many (great) features and improvements later on.
*/
@interface ASTableNode : ASDisplayNode <ASRangeControllerUpdateRangeProtocol>
@interface ASTableNode : ASDisplayNode <ASRangeControllerUpdateRangeProtocol, ASRangeManagedNode>

- (instancetype)init; // UITableViewStylePlain
- (instancetype)initWithStyle:(UITableViewStyle)style NS_DESIGNATED_INITIALIZER;
Expand Down
2 changes: 1 addition & 1 deletion Source/ASTableNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ - (instancetype)initWithStyle:(UITableViewStyle)style
[self setViewBlock:^{
// Variable will be unused if event logging is off.
__unused __typeof__(self) strongSelf = weakSelf;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the strongSelf necessary? If the viewBlock is running, self shouldn't be nil, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep but we should strongify once, rather than implicitly strongifying each time we use weakSelf.

return [[ASTableView alloc] _initWithFrame:CGRectZero style:style dataControllerClass:nil eventLog:ASDisplayNodeGetEventLog(strongSelf)];
return [[ASTableView alloc] _initWithFrame:CGRectZero style:style dataControllerClass:nil owningNode:strongSelf eventLog:ASDisplayNodeGetEventLog(strongSelf)];
}];
}
return self;
Expand Down
51 changes: 19 additions & 32 deletions Source/ASTableView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ - (void)prepareForReuse
#pragma mark -
#pragma mark ASTableView

@interface ASTableView () <ASRangeControllerDataSource, ASRangeControllerDelegate, ASDataControllerSource, _ASTableViewCellDelegate, ASCellNodeInteractionDelegate, ASDelegateProxyInterceptor, ASBatchFetchingScrollView, ASDataControllerEnvironmentDelegate>
@interface ASTableView () <ASRangeControllerDataSource, ASRangeControllerDelegate, ASDataControllerSource, _ASTableViewCellDelegate, ASCellNodeInteractionDelegate, ASDelegateProxyInterceptor, ASBatchFetchingScrollView>
{
ASTableViewProxy *_proxyDataSource;
ASTableViewProxy *_proxyDelegate;
Expand Down Expand Up @@ -266,22 +266,35 @@ + (Class)dataControllerClass
#pragma mark -
#pragma mark Lifecycle

- (void)configureWithDataControllerClass:(Class)dataControllerClass eventLog:(ASEventLog *)eventLog
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style
{
return [self _initWithFrame:frame style:style dataControllerClass:nil owningNode:nil eventLog:nil];
}

- (instancetype)_initWithFrame:(CGRect)frame style:(UITableViewStyle)style dataControllerClass:(Class)dataControllerClass owningNode:(ASTableNode *)tableNode eventLog:(ASEventLog *)eventLog
{
if (!(self = [super initWithFrame:frame style:style])) {
return nil;
}
_cellsForVisibilityUpdates = [NSMutableSet set];
_cellsForLayoutUpdates = [NSMutableSet set];
if (!dataControllerClass) {
dataControllerClass = [[self class] dataControllerClass];
}

_layoutController = [[ASTableLayoutController alloc] initWithTableView:self];

_rangeController = [[ASRangeController alloc] init];
_rangeController.layoutController = _layoutController;
_rangeController.dataSource = self;
_rangeController.delegate = self;

_dataController = [[dataControllerClass alloc] initWithDataSource:self eventLog:eventLog];
_dataController = [[dataControllerClass alloc] initWithDataSource:self node:tableNode eventLog:eventLog];
_dataController.delegate = _rangeController;
_dataController.environmentDelegate = self;


_leadingScreensForBatching = 2.0;
_batchContext = [[ASBatchContext alloc] init];

_automaticallyAdjustsContentOffset = NO;

_nodesConstrainedWidth = self.bounds.size.width;
Expand All @@ -293,25 +306,6 @@ - (void)configureWithDataControllerClass:(Class)dataControllerClass eventLog:(AS
super.dataSource = (id<UITableViewDataSource>)_proxyDataSource;

[self registerClass:_ASTableViewCell.class forCellReuseIdentifier:kCellReuseIdentifier];
}

- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style
{
return [self _initWithFrame:frame style:style dataControllerClass:nil eventLog:nil];
}

- (instancetype)_initWithFrame:(CGRect)frame style:(UITableViewStyle)style dataControllerClass:(Class)dataControllerClass eventLog:(ASEventLog *)eventLog
{
if (!(self = [super initWithFrame:frame style:style])) {
return nil;
}
_cellsForVisibilityUpdates = [NSMutableSet set];
_cellsForLayoutUpdates = [NSMutableSet set];
if (!dataControllerClass) {
dataControllerClass = [[self class] dataControllerClass];
}

[self configureWithDataControllerClass:dataControllerClass eventLog:eventLog];

if (!AS_AT_LEAST_IOS9) {
_retainedLayer = self.layer;
Expand Down Expand Up @@ -1694,13 +1688,6 @@ - (BOOL)dataController:(ASDataController *)dataController presentedSizeForElemen
return (fabs(rect.size.height - size.height) < FLT_EPSILON);
}

#pragma mark - ASDataControllerEnvironmentDelegate

- (id<ASTraitEnvironment>)dataControllerEnvironment
{
return self.tableNode;
}

#pragma mark - _ASTableViewCellDelegate

- (void)didLayoutSubviewsOfTableViewCell:(_ASTableViewCell *)tableViewCell
Expand Down
2 changes: 1 addition & 1 deletion Source/ASTableViewInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*
* @param eventLog An event log passed through to the data controller.
*/
- (instancetype)_initWithFrame:(CGRect)frame style:(UITableViewStyle)style dataControllerClass:(Class)dataControllerClass eventLog:(ASEventLog *)eventLog;
- (instancetype)_initWithFrame:(CGRect)frame style:(UITableViewStyle)style dataControllerClass:(Class)dataControllerClass owningNode:(ASTableNode *)tableNode eventLog:(ASEventLog *)eventLog;

/// Set YES and we'll log every time we call [super insertRows…] etc
@property (nonatomic) BOOL test_enableSuperUpdateCallLogging;
Expand Down
1 change: 1 addition & 0 deletions Source/AsyncDisplayKit.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#import <AsyncDisplayKit/ASCollectionViewLayoutInspector.h>
#import <AsyncDisplayKit/ASCollectionViewLayoutFacilitatorProtocol.h>
#import <AsyncDisplayKit/ASCellNode.h>
#import <AsyncDisplayKit/ASRangeManagedNode.h>
#import <AsyncDisplayKit/ASSectionContext.h>

#import <AsyncDisplayKit/ASElementMap.h>
Expand Down
5 changes: 3 additions & 2 deletions Source/Details/ASCollectionElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#import <AsyncDisplayKit/ASTraitCollection.h>

@class ASDisplayNode;
@protocol ASRangeManagedNode;

NS_ASSUME_NONNULL_BEGIN

Expand All @@ -28,13 +29,13 @@ AS_SUBCLASSING_RESTRICTED
//TODO change this to be a generic "kind" or "elementKind" that exposes `nil` for row kind
@property (nonatomic, readonly, copy, nullable) NSString *supplementaryElementKind;
@property (nonatomic, assign) ASSizeRange constrainedSize;
@property (nonatomic, weak) ASDisplayNode *owningNode;
@property (nonatomic, readonly, weak) id<ASRangeManagedNode> owningNode;
@property (nonatomic, assign) ASPrimitiveTraitCollection traitCollection;

- (instancetype)initWithNodeBlock:(ASCellNodeBlock)nodeBlock
supplementaryElementKind:(nullable NSString *)supplementaryElementKind
constrainedSize:(ASSizeRange)constrainedSize
owningNode:(ASDisplayNode *)owningNode
owningNode:(id<ASRangeManagedNode>)owningNode
traitCollection:(ASPrimitiveTraitCollection)traitCollection;

/**
Expand Down
2 changes: 1 addition & 1 deletion Source/Details/ASCollectionElement.mm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ @implementation ASCollectionElement {
- (instancetype)initWithNodeBlock:(ASCellNodeBlock)nodeBlock
supplementaryElementKind:(NSString *)supplementaryElementKind
constrainedSize:(ASSizeRange)constrainedSize
owningNode:(ASDisplayNode *)owningNode
owningNode:(id<ASRangeManagedNode>)owningNode
traitCollection:(ASPrimitiveTraitCollection)traitCollection
{
NSAssert(nodeBlock != nil, @"Node block must not be nil");
Expand Down
Loading