-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Changes from 5 commits
b68f10e
a31cdc6
00ecf6b
bc4d4a3
73ace20
eb25898
828f9c9
6749aad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
- 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) | ||
- [Yoga Beta] Improvements to the experimental support for Yoga layout [Scott Goodson](appleguy) | ||
- [Yoga Beta] Improvements to the experimental support for Yoga layout [Scott Goodson](appleguy) | ||
- 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] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// ASRangeManagedNode.h | ||
// Texture | ||
// | ||
// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import <AsyncDisplayKit/ASTraitCollection.h> | ||
|
||
@class ASCellNode; | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
/** | ||
* Basically ASTableNode or ASCollectionNode. | ||
*/ | ||
@protocol ASRangeManagedNode <NSObject, ASTraitEnvironment> | ||
|
||
/** | ||
* 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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,7 +80,7 @@ - (instancetype)initWithStyle:(UITableViewStyle)style | |
[self setViewBlock:^{ | ||
// Variable will be unused if event logging is off. | ||
__unused __typeof__(self) strongSelf = weakSelf; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
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; | ||
|
There was a problem hiding this comment.
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 withASHierarchyStateRangeManaged
state naming.