0

this section doesn't work with swift2 branch:

https://github.com/stephencelis/SQLite.swift/blob/swift-2/Documentation/Index.md#binary-data

I get:

Redundant conformance of 'NSData' to protocol 'Value'

and

Type 'UIImage' does not conform to protocol 'Value'

SingerOfTheFall
  • 29,228
  • 8
  • 68
  • 105
  • The `swift-2` branch (for now) already implements conformance with NSData, so you shouldn't need to implement the extension yourself anymore! – stephencelis Sep 23 '15 at 11:52
  • Thanks Stephen, still have problem extending UIImage. Also in swift-2 branch it looks like db.userVersion is not available anymore, is there a way to track db version? – Paolo Bernardini Sep 28 '15 at 09:27
  • Check out the extension here for a workaround: https://github.com/stephencelis/SQLite.swift/issues/194 A new pragma interface is coming in a future version. What does your UIImage extension look like? – stephencelis Sep 28 '15 at 21:28

1 Answers1

0

I have used the code from your documentation example

extension NSData: Value {
class var declaredDatatype: String {
    return Blob.declaredDatatype
}
class func fromDatatypeValue(blobValue: Blob) -> Self {
    return self(bytes: blobValue.bytes, length: blobValue.length)
}
var datatypeValue: Blob {
    return Blob(bytes: bytes, length: length)
}

}