I have an [[String:Any]] object populated like:
[[String:Any]]
var result : [[String : Any]] = [[String : Any]]()
And I need convert it to D
D
JSONEncoder can only encode objects whose type conforms to Encodable. If you want to encode Any to JSON, you need to use JSONSerialization to do that.
JSONEncoder
Encodable
Any
JSONSerialization
let jsonData = try? JSONSerialization.data(withJSONObject:result)