Reputation: 36305
So far the answer from Martin R has worked perfectly. But starting with Swift2 it now raises the error
Cannot invoke initializer for type 'sqlite3_destructor_type' with an argument list of type '(COpaquePointer)'
in those lines:
private let SQLITE_STATIC = sqlite3_destructor_type(COpaquePointer(bitPattern: 0)) // https://stackoverflow.com/a/26884081/1271826
private let SQLITE_TRANSIENT = sqlite3_destructor_type(COpaquePointer(bitPattern: -1))
Upvotes: 4
Views: 1368
Reputation: 36305
Taken from the github post provided courtesy of @MartinR the answer is
internal let SQLITE_STATIC = unsafeBitCast(0, sqlite3_destructor_type.self)
internal let SQLITE_TRANSIENT = unsafeBitCast(-1, sqlite3_destructor_type.self)
Upvotes: 4