-
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
[ASWrapperCellNode] Introduce a new class allowing more control of UIKit passthrough cells. #797
Conversation
…UIKit passthrough cells. A few minor fixes to Collections behavior as well, including a new isSynchronized API. The difference from processingUpdates is that after Synchronized, all animations have also completed (or runloop turn if animations disabled, so .collectionViewLayout can be relied on being fully in sync). More upstreaming to come after this can land...
BTW, I'm thinking it would be optimal to iterate on some things like this while they are in +Private or +Beta headers. Let me know what you all would suggest. There's a backlog of APIs like this which are pretty well tested, but not necessarily flawless for broad public consumption, so it might be easiest to get them in (if they seem generally useful) and evolve towards public. |
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.
This is a pretty clever idea – a reasonably straightforward way to pipe data through Texture while using passthrough. 👍
Source/ASCollectionNode.h
Outdated
* | ||
* When isSynchronized == YES, the block is run block immediately (before the method returns). | ||
*/ | ||
- (void)onDidFinishSynchronizing:(nullable void (^)(void))didFinishSynchronizing; |
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.
Nit: This decl says nullable
but the impl will crash with a nil block.
Probably best to let this argument default to nonnull
since I can't think of a use case for knowingly passing nil in here and also add a nil check in the implementation.
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.
@Adlai-Holler cool, fixed all definitions (and also made the change for the existing onDidFinishProcessingUpdates:).
I moved Synchronizing to +Beta for now. A better name might be onDidFinishSynchronizingLayout, or ...LayoutSynchronization. Or even merging with onDidFinishProcessingUpdates with the option to specify a type of "finished", with synchronized including the end of animation. It's all a bit subtle and confusing, but having this call point available has been very useful even as the name remains a bit unclear.
Source/ASCollectionNode.h
Outdated
/** | ||
* Returns YES if the ASCollectionNode contents are completely synchronized with the underlying collection-view layout. | ||
*/ | ||
@property (nonatomic, readonly) BOOL isSynchronized; |
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.
synchronized
with an isSynchronized
getter?
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.
@Adlai-Holler This is an interesting case because it's a read-only property, so only the getter applies. I'm happy to change it in the name of convention, though it felt a bit unusual to write!
@Adlai-Holler thanks! In practice I've found it's useful to be able to hook into ASInterfaceState calls, even for cells that rely on a more traditional architecture. It's possible to define your own delegate on a subclass of ASWrapperCellNode, and pair it with a specific hand-authored NSObject "cell controller" or other pattern that a standard UIKit app might use, and integrate more elegantly with true ASCellNodes. Agree with your feedback, will update. |
…exture into ASWrapperCellNode
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.
Approved again, great diff and I regret letting this linger here for so long. ✅
Looks like there was a subtle behavior change on the
|
…sactionQueueCount management.
…g ASMainSerialQueue.
…g the real fix before this.
Generated by 🚫 Danger |
Maybe useful for debugging CI - even after fixing the test failure, I got the spurious failure below. Fingers crossed that the re-run is successful. These logs seem to suggest a simulator / local environment error. @Adlai-Holler, @garrettmoon — is it possible that updating our default Xcode and/or iOS version for tests could improve this? iOS 10.2 is pretty old now; if 11.2 has any screenshot diff failures, can we pass with 10.3 and see if it improves?
|
=/ Sucky to see that. Since it's an Xcode failure, I guess that changing iOS versions wouldn't do much but changing Xcode versions might. Fingers crossed here too, that the rebuild works. |
Yeah, you're probably right. Xcode version would be the best bet. Is it viable to update more on our current build service? That said, as an "omg it almost never works, let's try anything!" approach — the SDK version does actually affect all of the Simulator-related frameworks, e.g. including the OS X hooks / interfaces to Xcode. So, there's at least a chance it would help. |
Thanks for all your help Adlai! |
…Kit passthrough cells. (TextureGroup#797) * - [ASWrapperCellNode] Introduce a new class allowing more control of UIKit passthrough cells. A few minor fixes to Collections behavior as well, including a new isSynchronized API. The difference from processingUpdates is that after Synchronized, all animations have also completed (or runloop turn if animations disabled, so .collectionViewLayout can be relied on being fully in sync). More upstreaming to come after this can land... * Fix -[ASDataController clearData] to take no action before initial data loading. * Empty commit to kick CI * Spacing change to kick CI (since an empty commit doesn't work...) * Tweak ASDataController changes to handle an edge case in _editingTransactionQueueCount management. * Avoid excess cyclic calls to onDidFinishProcessingUpdates: by avoiding ASMainSerialQueue. * Reverting my initial change as it wasn't the right approach, following the real fix before this.
A few minor fixes to Collections behavior as well, including a new isSynchronized
API. The difference from processingUpdates is that after Synchronized, all animations
have also completed (or runloop turn if animations disabled, so .collectionViewLayout
can be relied on being fully in sync).
More upstreaming to come after this can land...