Closed
Description
The docs below seems outdated, any idea to make it work in swift 3 ?
extension NSData: Value {
class var declaredDatatype: String {
return Blob.declaredDatatype
}
class func fromDatatypeValue(blobValue: Blob) -> Self {
return self(bytes: blobValue.bytes, length: blobValue.bytes.count)
}
var datatypeValue: Blob {
return Blob(bytes: bytes, length: length)
}
}
// assumes NSData conformance, above
extension UIImage: Value {
public class var declaredDatatype: String {
return Blob.declaredDatatype
}
public class func fromDatatypeValue(blobValue: Blob) -> UIImage {
return UIImage(data: NSData.fromDatatypeValue(blobValue))!
}
public var datatypeValue: Blob {
return UIImagePNGRepresentation(self)!.datatypeValue
}
}
Metadata
Metadata
Assignees
Labels
No labels