Latest 0.8.1
License Apache 2.0, ObjectBox Binary License
Platforms ios 10.0, osx 10.10

ObjectBox Swift


ObjectBox is a superfast, light-weight object persistence framework.
This Swift API seamlessly persists objects on-device for iOS and macOS.

let santa = Person(firstName: "Santa", lastName: "Claus")
try personBox.put(santa)

let query: Query<Person> = personBox.query {
    return (Person.firstName.contains("Santa") || Person.age > 100)
           && Person.lastName.isEqual(to: "Claus") 
let oldClauses = query.find()

Want details? Read the guides or
check out the API docs.

Note: This beta version is subject to change (details below).


ObjectBox is available through CocoaPods.
To install the pod, simply add the following line to your Podfile:

pod 'ObjectBox'

Then run

cd /path/to/your/project/folder/ # whatever folder your Podfile is in.
pod install
Pods/ObjectBox/setup.rb myproject.xcodeproj # whatever your Xcode project is named

afterwards to install the framework and its dependencies, and set up the code generator in your project.

If pod install fails, try updating CocoaPods first:

gem update xcodeproj && gem update cocoapods && pod repo update


In the Example directory, you find a notes example app demonstrating ObjectBox’s Swift API.
The example comes with two apps: one for iOS and one for macOS.

To setup the example, use CocoaPods to acquire the framework:

cd Example/
pod install # if that fails, update CocoaPods (see Installation)

This will generate a NotesExample.xcworkspace that you can launch to try out ObjectBox.

How can ObjectBox Help You?

We want ObjectBox to be not only the fastest, but also the most Swift-friendly persistence solution.

To do that, we want your feedback: what do you love? What’s amiss?
Where do you struggle in everyday app development?

We’re looking forward to receiving your comments and requests:

Thank you!

What’s Missing in the Beta?

More relation types, data observers, object browser.
This functionality is available at lower layers and has not yet been exposed to Swift.

Keep in touch

We’re obviously not finished here.
Sign up here for future updates on ObjectBox Swift.

For general news on ObjectBox, check our blog.

Background: Code generation

ObjectBox Swift generates code at build time for optimal performance at runtime by avoiding reflection etc.
This is automatically done for you and should be transparent. Internally, we use Sourcery for this.

Other languages/bindings

ObjectBox is a multi platform database supporting multiple languages:

  • ObjectBox C API: native speed with zero copy access to FlatBuffer objects;
    also enables porting ObjectBox to other languages.
  • ObjectBox Java: runs on Android, desktop and even servers.


All files in this repository are under the Apache 2 license:

Copyright 2018 ObjectBox Ltd. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

Latest podspec

    "name": "ObjectBox",
    "version": "0.8.1",
    "summary": "ObjectBox is a superfast, lightweight database for objects.",
    "description": "ObjectBox is a superfast object-oriented database with strong relation support. ObjectBox is embedded into your Android, Linux, iOS, macOS, or Windows app.",
    "homepage": "",
    "license": "Apache 2.0, ObjectBox Binary License",
    "social_media_url": "",
    "authors": [
    "swift_version": "5.0",
    "platforms": {
        "ios": "10.0",
        "osx": "10.10"
    "source": {
        "http": ""
    "preserve_paths": "{templates,*.rb,*.sh,*.command,*.app}",
    "ios": {
        "vendored_frameworks": "Carthage/Build/iOS/ObjectBox.framework"
    "osx": {
        "vendored_frameworks": "Carthage/Build/Mac/ObjectBox.framework"

Pin It on Pinterest

Share This