Connect with us


Crush – Code with Core Data in a Swifty way

Enhance the development experience with CoreData by providing greater type-safety and intuitive functionality


🕹️ Take full control of your CoreData management.
🧑‍💻 100% managed code, no code generation required.
📖 Free from Xcode GUI, and human-friendly diff records on git.


Make sure you’ve declared Crush as your dependency before getting started

let package = Package(
  dependencies: [
      url: "",
      from: "TARGET_VERSION"
  targets: [
      name: "<your-target-name>",
      dependencies: [


Only three steps to start using Crush

1. Define your schema

class Todo: Entity {
    var title = Value.String("title") // A required string property named "title"

    var memo = Value.String("memo") // An optional string property named "memo"

    var finished = Value.Bool("finished")

    var parent = Relation.ToOne<Todo>("parent") // An optional relationship to another Todo

    var children = Relation.ToMany<Todo>("children")

2. Create your DataContainer

let container = try DataContainer.load(
    storages: .sqlite(url: targetURL), 
    dataModel: DataModel(name: "V1", [ Todo() ]))

3. Start coding 🔥🔥🔥

try container.startSession().sync { context in
    let todo = context.create(Todo.self)
    todo.title = "Hello Crush"
    try context.commit()


Swift DocC style documentation is available here.