Skip to content

Instantly share code, notes, and snippets.

@khoogheem
khoogheem / Swift iOS Platform Type
Last active September 14, 2015 08:14
Swift Version of getting the Device information... Tuple based.. provides Device type, description and optional version number
public class Diagnostics : NSObject {
//MARK: Device Platform
/** A String value of the device platform information */
private class var platform: String {
// Declare an array that can hold the bytes required to store `utsname`, initilized
// with zeros. We do this to get a chunk of memory that is freed upon return of
// the method
var sysInfo: [CChar] = Array(count: sizeof(utsname), repeatedValue: 0)