3lvis / DATAStack

100% Swift Simple Boilerplate Free Core Data Stack. NSPersistentContainer
Other
214 stars 44 forks source link

New method: newMainContext() #82

Closed Sorix closed 7 years ago

Sorix commented 8 years ago

I’ve tested different solutions to support cancellable/revertable UI modifications with Core Data and stopped on newMainContext() method that I’m using currently in my app.

It’s not good way to use main context to mutate data, but there is only one way if you’re working with UI directly, for example:

I’m finished that creating newMainContext for that is the best solution for that. I’m using that method currently in my app and it works very well. If you agree to add this method, I can update that pull request to the latest DATAStack version. If not, just close that pull request, anyway I can use forked one :).

Linked issue #74 with previous discussions.

3lvis commented 7 years ago

Hi Sorix! Thanks for revisiting on this pull request.

I'm gonna move it to a branch on this repo so we can keep experimenting.

Sorix commented 7 years ago

Oh elvis, I've accidently added [Test] merge errors 2 minutes before your merged that commit (just to do dirty tests), can you remove that commit please, sorry? My bad sorry :(

I'm right now testing that method because I've received 1 crash and I'm heavily investigating that issue now, it may be connected with that method.

Sorix commented 7 years ago

Or remove that branch, I will check that issue today/tomorrow, if it causes even 1 crash it can't be used in dataStack.

3lvis commented 7 years ago

@Sorix You have been added as a contributor to this repo, so it's easier for you to help out :)