PREMKUMAR PREMKUMAR - 10 months ago 109
Swift Question

Swift Can't Import Sqlite3 iOS

I added

to my project, and then I tried to import using the following code:

import UIKit
import sqlite3

class Dataware: NSObject


But it's giving me this error:

No Such Module 'sqlite3'


Add it to your Bridging-Header.h file:

#import <sqlite3.h>

This is the primary mechanism for importing any C-language libraries.

If you don't yet have a Bridging-Header.h file:

  1. Add a file Bridging-Header.h (or more typically (ProjectName)-Bridging-Header.h
  2. Go to the build settings tab for your project
  3. Find "Objective-C Bridging Header". The easiest way is to search for bridging.
  4. Enter the name and path for the file you created in step one. It's probably (ProjectName)/(ProjectName)-Bridging-Header.h