I have an int array I want to pass it to byte array, how could I do it, either for swift 2.3 or objetive-c
let constant : [Int] = [0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00];
I want to turn it into
let constant2 : [UInt8] = [.......]
It does not matter if it's all one hit, or position by position, that is, take the value of 0xC0 and pass it to byte and put it in the position of the array. But I do not know how.
an example in java would have this result
//[Int] swift es un array de enteros
[192, 192, 192, 192, 0, 0, 0, 0, 192, 192, 192, 192, 0, 0, 0, 0]
//[UInt] swift es un array de bytes solo que en java es diferente pero algo asi quiero hacer.
[-64, -64, -64, -64, 0, 0, 0, 0, -64, -64, -64, -64, 0, 0, 0, 0]