##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"
}
class AppDelegate: UIResponder, UIApplicationDelegate {
lazy var seruStack = Seru()
...
}
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
Seru is available through CocoaPods. To install :
- Install latest version of cocoapods
[sudo] gem install cocoapods --pre
- Add the following line to your Podfile:
use_frameworks!
pod 'Seru'
Installation is available using the dependency manager Carthage.
- Install Carthage
brew install carthage
- Add the following line to your Cartfile file
github "kostiakoval/Seru"
- Run
carthage update
- Add Seru.framework (from Carthage/build directory) to your project.
mkdir Vendor # you can keep your submodules in their own directory
git submodule add git@github.com:kostiakoval/Seru.git Vendor/Seru
git submodule update --init --recursive
- CoreData Stack with background saving context
- Background data importer stack
- Error handler with UIAlertView
- Creating child contexts
- Differents CoreData Stacks support
Kostiantyn Koval
@KostiaKoval
Seru is available under the MIT license. See the LICENSE file for more info.