iOSEdit on GitHub
Sync Gateway Admin REST API: Go Python
Couchbase Lite REST API: Java C# Swift Python
- iOS 7 for building iOS apps
- macOS 10.9 for building macOS apps
- Download the latest release of Couchbase Lite for iOS.
- Unzip the file.
- Open the Couchbase Lite folder and drag CouchbaseLite.framework to the project navigator in Xcode.
- In the Choose options for adding these files sheet, make sure that your app target is selected.
Couchbase Lite requires additional frameworks and libraries for building an app. These additional dependencies are added via Xcode build settings.
- In the Xcode navigator, click on the project open the Build Settings tab.
- Scroll to the Linking section, find the Other Linker Flags row and then add the flag -ObjC (be sure to use the capitalization shown).
- Click the Build Phases tab.
- Expand the Link Binary With Libraries section and add the following items.
CFNetwork.framework Security.framework SystemConfiguration.framework libsqlite3.dylib libz.dylib libc++.dylib
#import <CouchbaseLite/CouchbaseLite.h> at the top of Objective-C files to import Couchbase Lite. For Swift projects, add the import statement in the bridging header.
For a Mac OS target, you'll need to make sure the framework is copied to your app's bundle. Follow the steps below.
- Download the latest release of Couchbase Lite for iOS from here.
- Open the Build Settings tab of your app target's settings.
- In the Linking section, edit Runpath Search Paths and add
- Now switch to the Build Phases.
- Press the Add Build Phase button at the top of the window and create a new Copy Files phase.
- Set the phase's destination to Frameworks.
- Press the + button below the phases' file list and select CouchbaseLite.framework to add it.
- Install Cocoapods
Podfile, add the following.
pod 'couchbase-lite-ios', '~> 1.3.1'
(Optional) To enable encryption with SQLite, add the following subspec.
pod 'couchbase-lite-ios', '~> 1.3.1' pod 'couchbase-lite-ios/SQLCipher', '1.3.1'
From the command line, run
.xcworkspacefile generated by CocoaPods to work on your project.
- Install Carthage
- Add github "couchbase/couchbase-lite-ios" to your Cartfile.
CouchbaseLite.frameworkfrom the appropriate platform directory in
Carthage/Build/to the "Embedded Binaries" section of your Xcode project's "General" settings.
The SDK contains other dependencies that are optional. Here's what each one does:
- CBLJSONValidator: Validates JSON objects against JSON-Schema specs.
- libCBLForestDBStorage.a: To use the ForestDB storage type.
- libsqlcipher.a: To enable encryption on SQLite databases.
- Extras/CBLEncryptionController: Utility class to handle password entry. Prompts the user to make up a key, asks for the key when re-opening the database, and asks again if the key was incorrect. It even takes advantage of Touch ID fingerprint authentication on recent iOS devices to avoid making the user deal with a password at all.
- Extras/CBLIncrementalStore: A subclass of the NSIncrementalStore to allow Core Data to use a Couchbase Lite database as its persistent storage instead of the default SQLite database.
- Extras/CBLUICollectionSource: A UICollectionView data source driven by a CBLLiveQuery.