CBL 1.4 to 2.x migration

We are starting the ground work to migrate our iPad app from CBL v1.4 to v2.x. It’s an objective-c app.

Is there any sample projects for v2.x in objective-c?

Is there a migration guide to moving to the new v2.x api?

Cheers,

Todd

We do not have a migration guide for 1.x to 2.x API but this blog post from a community user should be a good starting point (its for android- concepts should apply to other platforms) .

In terms of database migration, the docs should describe what you need.

Curious- you mentioned ObjC apps- are you planning on moving to swift? ICYMI, we have a native swift API in 2.x thats idiomatic to that platform (unlike the 1.x way of bridging ObjC to swift)

Thanks for the info.

Currently we are not planning on moving to Swift. It’s a really large codebase and moving to swift is not cost effective.

Please do not drop support for objective-c. There are WAY more objective-c apps than swift apps out there.

T

Biggest changes for us going from 1.x to 2.x:

  • no access to previous revisions
  • auto conflict resolution
  • no models
  • query language is different but more powerful

I’m going to REALLY miss models. Our app using them a ton.

T

The Android version of CBL 1.x did not ship with model functionality. If your iOS application uses CBLModel, those concepts may not apply.

One approach would be to either use composition or completely reimplement key parts of the 1.x Objective-C API, using Swift and CouchbaseLiteSwift 2.x. This can act as a bridge to existing Objective-C models which subclass CBLModel and have @dynamic / @NSManaged properties, while allowing new features to be implemented in Swift and use the new modern CBL API.