简体   繁体   中英

How to import FMDB to a swift framework

I want to use FMDB in a swift framework. I follow this tutorial http://programmingthomas.com/blog/2014/7/23/sqlite-in-swift-frameworks but i am getting this error.

Opening import file for module 'Swift': Not a directory

I did all the steps exactly as mentioned in the tutorial.

Also i tried to import the files (not create a seperate framework) but it gives me an error saying that cannot import a non modular header file.

FYI, you can now build framework for FMDB using the master branch, and using the swiftFramework branch that I discussed below is no longer needed. (That branch was created because of a problem in Xcode 6 and 7 that prevented the creation of frameworks that referenced non-modular headers.)

For example, see issue # 540 for an example of how to build the frameworks using Carthage. Note, you don't have to use Carthage, but it demonstrates that the swiftFramework branch isn't needed anymore.

I'll keep the original answer below for historical purposes, but it appears that it is no longer applicable. We can build FMDB framework without incident now in Xcode 8.


There is a FMDB branch (see swiftFramework branch ) that was created to allow you to create a separate framework for FMDB. For instructions on how to use it, see Using FMDB in a framework discussion at the end of the README for that branch.

Note, this is a separate branch and has not been integrated into the master branch (and probably won't until FMDB 3.0 because it includes some trivial, yet non-backward compatible changes). So, if you don't need it in a framework, I'd suggest just adding the the source to your project directly, rather than separate framework. But if you need a framework, the above branch may help you out.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM