I am converting by Obj-C code to Swift, but from last 2 days I am stuck on third line in below Obj-C code.
char encodedChar = (int)c + (int)kc;
NSLog(@"Encoded Char : %c", encodedChar); //prints like, Î, ¾, Ü etc.
const void *pt = &encodedChar;
[encodedData appendData:[NSData dataWithBytes:pt length:1]];
And this is my Swift Code,
let encodedChar = "\(character)".toInt()! + numbers[index]
let characterString = String(stringInterpolationSegment: UnicodeScalar(encodedChar))
println("Encoded Char String : \(characterString)") //prints same, Î, ¾, Ü etc.
But what next, what would be swift equivalent of : const void *pt = &encodedChar;
I do not want to convert my string to NSData. Because it behaves differently.
Any suggestion will be helpful, Thanks :)