Closed Valentin-VK closed 7 years ago
Hello! This code it's not working Decoding. Please help.
public struct Video { var id: Int! var title: String! } extension Video:JSONDecodable { init(json: JSON) throws { self.id = try json.getInt(at: "id") self.title = try json.getString(at: "title") } } public struct VideoArtist { var artistId: Int! var video: Video! } extension VideoArtist:JSONDecodable { init(json: JSON) throws { self.artistId = try json.getInt(at: "id") self.video = try? json.decode(at: "video", type: Video.self) } }
Error: In argument type 'Video.Type', 'Video' does not conform to expected type 'JSONDecodable'
Hello! This code it's not working Decoding. Please help.