Comments (8)
from composed.
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:
- A
- B
- C
then I pick up C and move (but don't drop) it:
- A
- (C)
- B
While it's in the this dragging state there's an insert of BB after B. Do I see:
- A
- (C)
- B
- BB
or
- A
- (C)
- B
?
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?
from composed.
Interesting thought. So when using NSFetchedResultsController
you get the following:
willChange
didChangeSection
didChangeItem
didChange
So generally you add a flag via suspend()
or wateva and essentially ignore updates to the UI from CoreData during the move.
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 resume()
and everything returns to normal.
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) A C B
.
How do you think we could handle this scenario?
I think this would have to be handled by each
section that supports Suspendible
. When updates received during a suspended state, would need to be cached and re-applied on resume()
.
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.
from composed.
Given the performance stuff you've uncovered as of late, I'm reluctant to continue with this ticket. Close JosephDuffy ?
from composed.
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.
from composed.
I was thinking about this while working on #18; the changes in that PR might helps this.
Not sure how that PR is directly associated, would be keen to hear your thoughts, but not a priority?
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.
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.
from composed.
I was thinking about this while working on #18; the changes in that PR might helps this.
Not sure how that PR is directly associated, would be keen to hear your thoughts, but not a priority?
I meant composed-swift/ComposedUI#15; the suspend
and resume
calls could use mappingWillBeginUpdating
/mappingWillBeginUpdating
, since that'll essentially ignore updates (from the UI's perspective)
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.
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.
Go ahead and close for now, but it's worth revisiting in case it helps and composed-swift/ComposedUI#15 helps.
from composed.
👍
from composed.
Related Issues (10)
- Project is unlicenced HOT 3
- [BUG] HOT 1
- Improve extensions for RandomAccessCollection HOT 5
- Merge Composed, ComposedUI, and ComposedLayouts packages HOT 14
- How to use `ComposedSectionProvider` with `Section`s that update? HOT 4
- `CollectionCoordinatorDelegate`'s background view does not behave as documented HOT 9
- Crash when update occurs as side effect of view configuration HOT 2
- Implement Drag and Drop API support HOT 1
- Implement reordering API HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from composed.