Reputation: 219
I am creating a framework in swift and I need to use sqlite.
I've imported #import <sqlite3.h>
to use it and I am writing it in .h file created by Xcode.
But while building, I am getting this error:
"include of non modular header inside framework module"
.
I have searched for this question but couldn't find an appropriate answer that solves my problem.
Upvotes: 2
Views: 3071
Reputation: 6451
To use SQLite in a custom framework, you need to include the sqlite3.h file directly into the project and then make that file public.
In your umbrella header file, make sure you add this line:
#include "sqlite3.h"
(Don't use the <sqlite3.h>
form as you're now including the file from your project)
You may notice that the umbrella header automatically adds the line #import <UIKit/UIKIt.h>
as shown below. If you don't need UIKit, then remove that line.
You can find a full example here: https://github.com/AaronBratcher/ALBNoSQLDB
Upvotes: 4
Reputation: 219
What I was missing was adding sqlite3.h explicitly. It won't be automatically added when you add libsqlite3.tbd library. Make sqlite3.h public and then import it as umbrella header.
Upvotes: 0