-
Notifications
You must be signed in to change notification settings - Fork 297
How to embed Couchbase Lite iOS into an existing Swift project
Traun Leyden edited this page Feb 28, 2018
·
1 revision
If you download the pre-built Couchbase Lite iOS and drop it into your project as a framework, it's not easy to set breakpoints in the Couchbase Lite iOS or LiteCore code.
This is mainly of interest to core Couchbase developers, but it might also be useful for users who are running into a crash and want to debug further to find out the root cause (which can in some cases speed up bug fixes)
This will use the mobile-training-todo sample app as an example app.
- In your project explorer, go to Frameworks and delete CouchbaseLite
-
git clone
the https://github.com/couchbase/couchbase-lite-ios repo somewhere - In the finder, navigate to the
CouchbaseLite.xcodeproj
- Drag
CouchbaseLite.xcodeproj
into the mobile-training-todo project (or your own project) - You should see something like this:
- If you don't have an "expander triangle" next to the
CouchbaseLite.xcodeproj
subproject, try restarting XCode - Under the top level project build settings, update Target Dependencies and Copy Files sections to include the subproject framework, like this:
- At this point, you should be able to build the project without errors
- Now you can set breakpoints anywhere inside Couchbase Lite ios or LiteCore
- Additionally, you can edit any files in Couchbase Lite iOS or LiteCore and rebuild, and the changes will get picked up