Introduce ASInterfaceState on ASDisplayNode. - #850
Conversation
Later, this will be added to ASViewController. Right now it is not hooked up to drive anything. It will become the codepath that drives calls like -fetchData and -clearContents.
There was a problem hiding this comment.
Shouldn't this need to be guarded by the mutex?
There was a problem hiding this comment.
Might be helpful to introduce a callback method: -[ASDisplayNode interfaceStateDidChange:(ASInterfaceState)previousState] for subclassing.
There was a problem hiding this comment.
Yes, absolutely. I may finish the initial internal implementation without this, but once proven to be the correct API, this will definitely be developer-facing and could conceivably even replace the fetch/clear methods
Sent from my iPhone
On Nov 23, 2015, at 4:27 PM, Levi McCallum notifications@github.com wrote:
In AsyncDisplayKit/ASDisplayNode.mm:
@@ -1683,6 +1683,18 @@ - (void)recursivelyClearFetchedData
[self clearFetchedData];
}+- (ASInterfaceState)interfaceState
+{
- return _interfaceState;
+}
+- (void)setInterfaceState:(ASInterfaceState)interfaceState
+{
- if (interfaceState != _interfaceState) {
Might be helpful to introduce a callback method: -[ASDisplayNode interfaceStateDidChange:(ASInterfaceState)previousState] for subclassing.—
Reply to this email directly or view it on GitHub.
There was a problem hiding this comment.
Added the locking, but decided to wait on interfaceStateDidChange: until we know what the protocol + adoption with ASViewController / table / collection will look like. The main known use case involves simply reading self.interfaceState (which is accessible) on setURL: or similar to check if a load should be kicked off. It is also possible to override -setInterfaceState: and call super if needed, but I agree this is not ideal for long term usage outside the framework.
There was a problem hiding this comment.
LOL. Fixed locally.
Fix Table View Updating Issues in #869 - typeahead including section and item adds / deletes
Trigger a relayout once the media image of PostNode in SocialAppLayout is loaded
[ASLayoutSpec] Implement horizontal and vertical alignments
Fix selection inconsistency in ASTableView/ASCollectionView cell implementation
Later, this will be added to ASViewController. Right now it is not hooked up to drive anything. It will become the codepath that drives calls like -fetchData and -clearContents.
Conflicts: AsyncDisplayKit/ASDisplayNode.h AsyncDisplayKit/ASDisplayNode.mm
|
@Adlai-Holler - check it out. Can you try this with a quick modification to ASMultiplexImageNode to see if you can have it kick off the network load if self.interfaceState & ASInterfaceStateFetchData? |
Introduce ASInterfaceState on ASDisplayNode.
There was a problem hiding this comment.
Could we have this be raw value 0? That way when it's imported into Swift, both [] and .None will correspond to the same value.
|
@appleguy Sure, this looks great! |
* fix SIMULATE_WEB_RESPONSE not imported facebookarchive#449 * Fix to make rangeMode update in right time * support animated image for cache * Modify change log
Later, this will be added to ASViewController. Right now it is not hooked up to drive anything.
It will become the codepath that drives calls like -fetchData and -clearContents.