Swiftpack.co - georgesjamous/CoreDataStack as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by georgesjamous.
georgesjamous/CoreDataStack 1.0.2
A Core Data Stack helper library
⭐️ 4
🕓 3 years ago
iOS
.package(url: "https://github.com/georgesjamous/CoreDataStack.git", from: "1.0.2")

CoreDataStack

Maintenance GitHub issues

This is a quick implementation of a reusable core data stack helper library.

Instead of writing the same redundant code, this contains some useful basic operations.

CoreDataStack is wrapped with a protocol so you can replace the implementation later on at will.


Installation

Swift Package Manager:

URL: https://github.com/georgesjamous/CoreDataStack.git

Usage Example

let model = NSManagedObjectModel(...)
let stack = try CoreDataStack(launchType: .inMemory, managedObjectModel: model)
let stack = try CoreDataStack(launchType: .onDisk(identifier: "com.products"), managedObjectModel: model)
let context = stack.mainContext // access the main context
let context = stack.backgroundContext // access the background context
context.commit() // commits changes up the chain of contexts


Feel free to open a PR

GitHub

link
Stars: 4
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

3 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics