I am using the compression library of Swift to compress an image as NSData. This is the code:
var imageCompressed:NSData
compression_encode_buffer( imageCompressed ,800000 , imageSelected , size , NULL , COMPRESSION_LZMA )
I am getting the following error message:
Cannot convert value of type NSData to expected argument type UnsafeMutablePointer
I think what you want is something like this (
imageSelected
andimageCompressed
are assumed to be Swift 3 Data objects):