I have tried to run the below code in swift 3
var values = [UInt8](count:data!.length, repeatedValue:0) data!.getBytes(&values, length:data!.length)
For Swift3 just use following:
let array = [UInt8](yourDataObject)
That's all, folks!)