This repo is designed to show you an app that allows users to log in and make changes to their user profile information. User profile information is persisted as a Document in the local Couchbase Lite Database. When the user logs out and logs back in again, the profile information is loaded from the Database. This app also demostrates how you can bundle, load, and use a
prebuilt
instance of Couchbase Lite and introduces you to the basics of theQueryBuilder
interface.
Full documentation can be found on the Couchbase Developer Portal.
To run this prebuilt project, you will need:
- Mac running MacOS 11 or 12
- Xcode 12/13 - Download latest version from the Mac App Store or via Xcodes
Note: If you are using an older version of Xcode, which you need to retain for other development needs, make a copy of your existing version of Xcode and install the latest Xcode version. That way you can have multiple versions of Xcode on your Mac. More information can be found in Apple's Developer Documentation
The Couchbase Documentation has examples on how to add Couchbase Lite via
- Swift Package Manager
- Cocoa Pods
- Carthage
- Direct Download
The sample app follows the MVP pattern, separating the internal data model, from a passive view through a presenter that handles the logic of our application and acts as the conduit between the model and the view
- Open
src/UserProfileQueryDemo.xcodeproj
using Xcode - Build and run the project.
- Verify that you see the login screen.
This tutorial walked you through an example of how to use a pre-built Couchbase Lite database and has a simple Query example to show you how to use the QueryBuilder
API in Swift.