I\'m looking for the simplest ways to achieve reasonable C interoperability in Swift, and my current block is converting an UnsafePointer (which was
extension NSData {
public func convertToBytes() -> [UInt8] {
let count = self.length / sizeof(UInt8)
var bytesArray = [UInt8](count: count, repeatedValue: 0)
self.getBytes(&bytesArray, length:count * sizeof(UInt8))
return bytesArray
}
}
You can convert row data to byts (Uint8)
Copy Extension and use it..