I already have an architecture setup with AFNetworking in my iOS app that is written in Obj-C. It returns the response as a Dictionary but I would like to play around with a pure JSON response to try Codable in Swift 4. Is that possible? Or what would be my options here?
One possible solution recreate a JSON :
var dataJson = try! JSONSerialization.data(withJSONObject: responseObject, options: JSONSerialization.WritingOptions.prettyPrinted)
var objCodable = try! JSONDecoder().decode(ObjCodable.self, from: dataJson)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With