Seru 0.1.2

Seru 0.1.2

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Sep 2015
SPMSupports SPM

Maintained by Kostiantyn Koval.



Seru 0.1.2

Seru (セル)

Core Data in Swift.

Seru (Cell in Japanese) is a clean and beautiful Core Data stack in Swift.
Seru is design to be light and fast and to fit all type of applications.

Use example: Setup Core Data in 1 line of code Seru() and insert object in background.

let seru = Seru()

seru.performBackgroundSave({ context in
  let person = Person(managedObjectContext: context)
  person.name = "Petter"
}

Usages

Setup CoreData

class AppDelegate: UIResponder, UIApplicationDelegate {            
  lazy var seruStack = Seru()
  ...
}

Actions

Save

var seruStack: Seru
seruStack.persist()

Perform background save. All the changes will be saved to the context

seruStack.performBackgroundSave({ context in
  let person = Person(managedObjectContext: context)
}

Perform background work

seruStack.performInBackgroundContext { context in
  let fetch = NSFetchRequest(entityName: "Person")
  var error: NSError?
  let result = context.executeFetchRequest(fetch, error: &error)
}

Installation

Submodules

mkdir Vendor # you can keep your submodules in their own directory
git submodule add [email protected]:kostiakoval/Seru.git Vendor/Seru
git submodule update --init --recursive

TODO

  • [ ] CoreData Stack with background saving context
  • [ ] Background data importer stack
  • [ ] Error handler with UIAlertView
  • [ ] Creating child contexts
  • [ ] Differents CoreData Stacks support

Author

Kostiantyn Koval
@KostiaKoval

License

Seru is available under the MIT license. See the LICENSE file for more info.