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

[ASCollectionView] synchronous mode #332

Merged
merged 5 commits into from
Jun 6, 2017

Conversation

hannahmbanana
Copy link
Contributor

@hannahmbanana hannahmbanana commented Jun 6, 2017

Adds a usesSynchronousDataLoading mode to ASCollectionView. When this mode is enabled, ASCollectionView matches the timing of UICollectionView as closely as possible, ensuring that all reload and edit operations are performed on the main thread as blocking calls.

This mode is useful for applications that are debugging issues with their collection view implementation. In particular, some applications do not correctly conform to the UICollectionView API, and these apps may experience difficulties with ASCollectionView. Providing this mode allows for developers to work on resolving their issues with the collection view data source, while ramping up on asynchronous collection layout.


- (void)setUsesSynchronousDataLoading:(BOOL)usesSynchronousDataLoading
{
self.view.usesSynchronousDataLoading = usesSynchronousDataLoading;
Copy link
Member

Choose a reason for hiding this comment

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

In the future, this may actually trigger a premature view allocation. Let's handle it now by putting the flag in pending state if the node is not loaded yet.

@@ -582,6 +582,10 @@ - (void)updateWithChangeSet:(_ASHierarchyChangeSet *)changeSet
}];
}];
});

if (_usesSynchronousDataLoading) {
dispatch_group_wait(_editingTransactionGroup, DISPATCH_TIME_FOREVER);
Copy link
Member

Choose a reason for hiding this comment

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

Can we call -waitUntilAllUpdatesAreCommitted instead?

Copy link
Member

@appleguy appleguy left a comment

Choose a reason for hiding this comment

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

@nguyenhuy I fixed up your comments - thanks for the review, those were good suggestions. Take another look when you can, and feel free to merge this if it looks correct.

@appleguy appleguy merged commit 9ca01b2 into TextureGroup:master Jun 6, 2017
bernieperez pushed a commit to AtomTickets/Texture that referenced this pull request Apr 25, 2018
* [ASCollectionView] synchronous mode

* add to changelog

* Update ASDataController.mm

* Update ASCollectionNode.mm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants