I have a very old Objective-C app that I am trying to convert to Swift. I am not well versed in Objective-C and even less so in pointers.
I have this code here that I can not figure out what to do with:
NSData *ucTimeData=[self getUcTime];
Byte *ucTimeByte = (Byte *)[ucTimeData bytes];
The NSData
looks like this when printing the description:
Printing description of data:
<9ea49c1d>
What would be the Swift equivalent of the Byte
conversion? ucTimeData.bytes
returns an unsafe pointer so something like:
let ucTimeByte: UInt8 = UInt8(ucTimeData.bytes)
which I guess would be the literal translation but it does not work.