问题
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))
回答1:
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)
来源:https://stackoverflow.com/questions/30760353/cannot-invoke-initializer-for-type-sqlite3-destructor-type