Swift Decode [String: Any]
问题 So I have this API that returns a dictionary of [String: Any] , I know that what comes as Any is Decodable or an array of Decodable however I can't for the life of me figure out how to take that dictionary and decode it to some struct: What I have goes basically like this: public func call<T: Codable> (completion handler: @escaping (T?) -> ()) { let promise = api.getPromise () promise.done (on: DispatchQueue.main, { (results: [String:Any]) let decodedResults:T? = results.decode (as: T.self) /