I just found this blog which helped to understand how to access ObjC that resides in a cocoa touch framework.
I followed the steps:
- Create a new Xcode workspace
- Create a new Cocoa Touch Framework called CouchbaseUtils
- Download Couchbase Lite iOS and drag CouchbaseLite.framework in the Xcode framework
- Drag all the headers in the public headers section in build settings like so:
- Add the following line in
CouchbaseUtils.h
to make the Couchbase Lite API accessible:
#import <CouchbaseUtils/CouchbaseLite.h>
- Create a new single view application in the same workspace
- In Link binary with libraries, add CouchbaseUtils.framework
- Import the Couchbase Utils framework in swift classes
import CouchbaseUtils
Now, you should be able to use this CouchbaseUtils framework in other projects. Here, Couchbase Lite isn’t a pod which means that you will have to re-import it when a new version is available. It would be great to make it work with cocoapods so we’d only change the podfile to pull the new version.
An example workspace can be found here http://cl.ly/2R323a1Y1M2F
James