-
Notifications
You must be signed in to change notification settings - Fork 3
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
Adding Suspendible
support
#10
Comments
I'm all for this. I see the problem it's fixing and can see how it would be a problem. But I'm wondering exactly how this works. Is there a method in Core Data to say "stop sending me updates"? If you perform the move while in this stopped state does it map the index paths of the changes performed during the move to what they should be after the move? If I had:
then I pick up C and move (but don't drop) it:
While it's in the this dragging state there's an insert of BB after B. Do I see:
or
? Once dropped I should see the first. At the time of the insert – from the perspective of the data source – it was inserted at index 2, but after the drop it would be index 3. If it's not inserting during the drop, does Core Data map to the correct index (2), or does Composed need to do this? |
Interesting thought. So when using
So generally you add a flag via On drop, you just need to update the model. The actual UI updates are not necessary (hence why you need to pause). After the drop, you call Now what you're asking is what happens if an update occurs in the background for example during the move? I've never actually encountered this but I would imagine this would cause a problem. I would imagine UI updates would be missed for those background updates, so the result would be (incorrectly) How do you think we could handle this scenario? I think this would have to be handled by The issue would be that you'd need to ignore the update for the move, since that's the whole point of the suspension. I think a diff library would best handle this since it would essentially just be comparing snapshots before and after at any stage. |
Given the performance stuff you've uncovered as of late, I'm reluctant to continue with this ticket. Close JosephDuffy ? |
I was thinking about this while working on #18; the changes in that PR might helps this. Between that and the performance improvements these things are more feasible. Focussing on the quality of the existing features is my main priority, but I don't think that means we need to close this, unless you don't plan to implement it for a while. EDIT: Just fixed the link above. |
Not sure how that PR is directly associated, would be keen to hear your thoughts, but not a priority?
Yeah my thinking was that this isn't really a 'requirement' as much as I expected it to be. So it might be a while or never even make it in. So cleaning up the issue made sense? If you really want to keep it open, that's fine, otherwise I think we could close this to keep focus. |
I meant composed-swift/ComposedUI#15; the
Go ahead and close for now, but it's worth revisiting in case it helps and composed-swift/ComposedUI#15 helps. |
👍 |
Adding
Suspendible
supportIntroduction
Composed should introduce the concept of a
Section
beingSuspendible
in order to prevent user-driven events triggering duplicate events in UIKit.Motivation
ManagedSection
is backed by CoreData and currently provides dedicated functions for suspending updates in order to support user-driven events (e.g. reordering).However the general pattern used by Composed is to 'discover' features through the use of a protocol. To bring this inline with the rest of Composed, I'm proposing we introduce a protocol to add support for this:
In addition I feel we should add similar methods to the appropriate
Coordinator
's:This is just to provide a simple convenience for the API consumer. The implementation would be:
Currently only
ManagedSection
would implement this protocol however formalising this approach allows customSection
's to piggy-back on this behaviour as well.Source compatibility
This should be purely additive.
Alternatives considered
N/A
The text was updated successfully, but these errors were encountered: