Swift: Codable - extract a single coding key
问题 I have the following code to extract a JSON contained within a coding key: let value = try! decoder.decode([String:Applmusic].self, from: $0["applmusic"]) This successfully handles the following JSONs: { "applmusic":{ "code":"AAPL", "quality":"good", "line":"She told me don't worry", } However, fails to extract a JSON with the coding key of applmusic from the following one: { "applmusic":{ "code":"AAPL", "quality":"good", "line":"She told me don't worry", }, "spotify":{ "differentcode":"SPOT"