import UIKit


struct Pos : Codable {
    let x:Int
    let y:Int
}

struct Map: Codable {
    let Poss: [Pos]
}

let jsonString: String = "{\"Poss\":[{\"x\":1234,\"y\":5678},{\"x\":436,\"y\":9873}]}"
let jsonData = jsonString.data(using: String.Encoding.utf8, allowLossyConversion: false)!
let json = try? JSONDecoder().decode(Map.self, from: jsonData)

results matching ""

    No results matching ""