Skip to content
This repository was archived by the owner on Nov 23, 2023. It is now read-only.

A simple Swift module for managing your Core Data stack and keeping track of different threads’ NSManagedContexts.

License

Notifications You must be signed in to change notification settings

lessthanyouthink/CoreDataStack.swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CoreDataStack.swift Carthage compatible

A simple Swift module for managing your Core Data stack and keeping track of different threads’ NSManagedContexts. Simply initialize a CoreDataStack instance with the URLs to your local model and store files, set it as the main stack, and use contextForCurrentThread() as needed.

This project is an experiment in rewriting the Core Data helper code I’ve used across a few different projects as something more modular and reusable (and in Swift!), rather than cluttering up the application delegate with a ton of boilerplate. The basic idea for how the contexts are used across threads is based on work from several years ago by my friend Jim Dovey.

It’s currently a little rough around the edges, and I’m not yet using this Swift version in production, but I thought it might be useful to share here for others to use or leave feedback.

About

A simple Swift module for managing your Core Data stack and keeping track of different threads’ NSManagedContexts.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages