[Solved] parsing Json in swift4

The error is very clear: …burzua_1.Status.(CodingKeys in _479ABD1AF7892C9F2FD23EC23214E088).status], debugDescription: “Expected to decode String but found a number instead.“ The value for key status is not in double quotes so it’s an Int class Status: Codable { let status: Int … Please don’t declare all properties carelessly as optional. For example status as well as all … Read more

[Solved] I get an Swift Decoding error: parsing JSON, found an Array expected a Dictionary? [duplicate]

Your json seems to be an array of Items, and not an object with a property named todoitems, so do this instead: let decodedData = try decoder.decode([Items].self, from: todoData) fetchedTitle = decodedData[1].title Your ToDoData struct can’t be used in this scenario, since your json doesn’t contain a property named todoitems. 0 solved I get an … Read more

[Solved] How to turn Any into Data

Could you make it easy for me to understand how it works? It doesn’t. The whole meaning of Any is that it could be anything. But not just anything can be turned into a Data. That is why protocols like Codable and NSCoding (to which SCNNode conforms) exist — and why Any cannot conform to … Read more