In Objective-C I use the following code to
Convert an Int variable into NSData, a packet of bytes.
Int
NSData
int myScore = 0; NS
You can convert in this way:
var myScore: NSInteger = 0 let data = NSData(bytes: &myScore, length: sizeof(NSInteger))