Serialization / Binary format

let dic = [1 : "one"2 : "two"]

//Encoding Binary Data
let encoder = PropertyListEncoder()
encoder.outputFormat = .binary
let data_b = try! encoder.encode(dic)

//Decoding Binary Data
let decoder = PropertyListDecoder()
let dic2 = try! decoder.decode(
    [Int : String].selffrom: data_b)
//dic2 is [2: "two", 1: "one"]
print("dic2 is \(dic2)")