Top "Codable" questions

Use this tag only for questions directly pertaining to the Swift Codable protocol introduced in Swift 4.

Using Alamofire and Codable for put request

I have a simple put request and I am using Alamofire's Parameters type to send data to the server. I …

json swift swift4 codable
How to convert a date string with optional fractional seconds using Codable in Swift4

I am replacing my old JSON parsing code with Swift's Codable and am running into a bit of a snag. …

swift swift4 nsdateformatter codable dateformatter
How to write a Swift 4 encoded JSON to a file?

How do you write a JSON object encoded via Swift 4 Codable protocol to a file? Before Swift 4 I used JSONSerialization.…

json swift serialization swift4 codable
Expected to decode Int but found a number instead

I had issue with JSON parsing in Swift 4.2. Here is the following code which shown runtime error. My Json data …

ios json codable decodable swift4.2
Convert received Int to Bool decoding JSON using Codable

I have structure like this: struct JSONModelSettings { let patientID : String let therapistID : String var isEnabled : Bool enum CodingKeys: String, CodingKey { …

swift4 codable
Ignore non-Codable optional properties in Codable object

When conforming to Codable protocol, I cannot easily skip optional property of non-Codable class In Ride struct we want to …

json swift swift4 codable decodable