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

[ASDataController] Remove asyncDataFetching Option, Cleanup #1794

Merged
merged 8 commits into from
Jun 24, 2016

Conversation

Adlai-Holler
Copy link
Contributor

I was doing a deep-dive into this code in preparation for some work, and I saw a bunch of possible improvements. So here they are.

  • Remove asyncDataFetching logic, deprecating the associated methods. We no longer call the locking methods because we now follow the UIKit synchronization paradigm – submit your edits on the main queue, and we'll query you back immediately on the main queue.
  • Add assertions to data controller about which queue we're on
  • Make data controller use _editingTransactionQueue even when doing synchronous reload (so that those assertions pass).
  • Other small tweaks/optimizations (avoiding needless allocations/method calls)

I've tested this thoroughly by hand.

@ghost ghost added the CLA Signed label Jun 21, 2016
@Adlai-Holler
Copy link
Contributor Author

@maicki @appleguy Review?

@Adlai-Holler
Copy link
Contributor Author

Those last two commits were going a little crazy, but here's the evidence for my comment about [NSIndexPath indexPathForItem:inSection:]:

screen shot 2016-06-21 at 3 22 41 pm

@Adlai-Holler Adlai-Holler force-pushed the AHDataControllerCleanup branch 2 times, most recently from 078d2f0 to 764c647 Compare June 23, 2016 22:42
[node measureWithSizeRange:constrainedSize];
node.frame = CGRectMake(0.0f, 0.0f, node.calculatedSize.width, node.calculatedSize.height);
CGSize size = [node measureWithSizeRange:constrainedSize].size;
node.frame = { .size = size };
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, is this guaranteed to properly initialize the .origin values? Or are they left uninitialized?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep! C++ will initialize all struct members to 0 by default so {} => CGRectZero etc.

@appleguy
Copy link
Contributor

@Adlai-Holler thank you for including the categories and deprecation flags to maintain compatibility. I reviewed this in quite heavy detail, but I am also partially trusting that there are not material changes subtly within some of the code blocks that were removed from the access data source with block sections.

@appleguy
Copy link
Contributor

@Adlai-Holler the detail is quite interesting on using Singleton objects for index paths only when initialized with the to argument method, thanks for including that.

Can you please add a comment where are you added the fork code path, because it is far from obvious why it would be worth the complexity to do so?

@appleguy appleguy merged commit 457e080 into master Jun 24, 2016
@Adlai-Holler Adlai-Holler deleted the AHDataControllerCleanup branch June 24, 2016 18:04
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.

2 participants