I use the Dropbox Datastore API in my application, and I finally made it work for Cocoa's built-in touch framework to share code for the Containing Application and Today Extension.
I realized that in my Swift file in the inline structure, I can import any third-party structure that I had in the project (e.g. Farbic.framework, Crashlytics, etc.), but not Dropbox.
What is the difference? Folder "Modules"! Dropbox.framework does not provide a module map file. So I created it based on what I found in Fabric.framework:
- Go to the Dropbox.framework folder in your directcotry project.
- Create a new folder "Modules" and go inside
- Create a file named: "module.modulemap"
File contents:
framework module Dropbox { umbrella header "Dropbox.h" export * module * { export * } }
After that I needed to add an import path.
- Go to the project file
- Choose the goal of embedded infrastructure
- Go to "Build Settings" and find "Quick Compiler - Search Paths"
- Add the path to your Dropbox.framerowk and set the "recursive" option.
I wanted to put a screenshot here, but I can not do it - because of my "reputation";)
Now I can do "import Dropbox" in my fast files :)
Hope this can help you :)
source share