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

Introduce ASInterfaceState on ASDisplayNode. - #850

Merged
appleguy merged 17 commits into
masterfrom
NodeLifecycle
Nov 30, 2015
Merged

Introduce ASInterfaceState on ASDisplayNode.#850
appleguy merged 17 commits into
masterfrom
NodeLifecycle

Conversation

@appleguy

Copy link
Copy Markdown
Contributor

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.

Levi McCallum and others added 4 commits November 11, 2015 01:05
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.
Comment thread AsyncDisplayKit/ASDisplayNode.mm Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't this need to be guarded by the mutex?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Might be helpful to introduce a callback method: -[ASDisplayNode interfaceStateDidChange:(ASInterfaceState)previousState] for subclassing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment thread AsyncDisplayKit/ASDisplayNode.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

elemant!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

LOL. Fixed locally.

nguyenhuy and others added 11 commits November 24, 2015 20:57
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
@appleguy

Copy link
Copy Markdown
Contributor Author

@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?

appleguy added a commit that referenced this pull request Nov 30, 2015
Introduce ASInterfaceState on ASDisplayNode.
@appleguy
appleguy merged commit ee7e311 into master Nov 30, 2015

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@Adlai-Holler

Copy link
Copy Markdown
Contributor

@appleguy Sure, this looks great!

@hannahmbanana
hannahmbanana deleted the NodeLifecycle branch July 11, 2016 02:11
peter-iakovlev pushed a commit to peter-iakovlev/AsyncDisplayKit that referenced this pull request Jul 21, 2018
* fix SIMULATE_WEB_RESPONSE not imported facebookarchive#449

* Fix to make rangeMode update in right time

* support animated image for cache

* Modify change log
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants