-
-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Issue 60 stack structure #72
Issue 60 stack structure #72
Conversation
|
||
Data between these two primary contexts and child contexts is kept in sync. | ||
Changes to a context are propagated to its parent context and eventually the persistent store when saving. | ||
Data between these two primary contexts is kept in sync using `NSManagedObjectContextDidSaveNotification` and `mergeChangesFromContextDidSaveNotification(_:)`. |
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.
let's change this to:
Data between the main and background contexts is perpetually kept in sync.
Whoa @Liquidsoul ! This is awesome! 👍 😄 Great work. Perfect pull request. ✨ Only one small comment to address, then I'll merge. Thanks so much for working on this! I'll be releasing this with |
Yep, agreed. I created #73 to follow up here. 😄
I think what you've done with the tests is great! 👍 Is there something specific you think we should change? |
mainContext is now directly connected to the persistent store coordinator instead of being a child of the background context.
Changes are merged between background and main contexts using `mergeChangesFromContextDidSaveNotification(_:)`
Thanks @jessesquires ! 😊 I've amended my last commit to change the documentation and rebased the branch.
I was wondering if the sibling context updates checks in |
@Liquidsoul ahhh, I see. I actually like this. Feels very thorough. 😄 |
Pull request checklist
This fixes issue #60
What's in this pull request?
mergeChangesFromContextDidSaveNotification(_:)
What's not in this pull request?
childContext
use the main context as parent. This may not be something we want with this new structure (at least not all the time).