From 8ed40b8a036e3043875666aab8e9f731a9ca6bb7 Mon Sep 17 00:00:00 2001 From: "Suresh, Kamlesh" Date: Wed, 20 Jan 2021 12:18:11 -0500 Subject: [PATCH] removed unused code --- MVMCore/MVMCore/Models/Model/ModelRegistry.swift | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/MVMCore/MVMCore/Models/Model/ModelRegistry.swift b/MVMCore/MVMCore/Models/Model/ModelRegistry.swift index 59dc0c7..93407d1 100644 --- a/MVMCore/MVMCore/Models/Model/ModelRegistry.swift +++ b/MVMCore/MVMCore/Models/Model/ModelRegistry.swift @@ -66,22 +66,6 @@ public struct ModelRegistry { return AnyCodingKey(category.codingKey) } - - - public static func getModelFor(json: [String: Any], type: T.Type) throws -> ModelProtocol? { - - guard let categoryKey = ModelRegistry.getCategory(for: type)?.codingKey else { - throw ModelRegistry.Error.other(message: "coding key missing") - } - guard let parameterType = json.optionalStringForKey(categoryKey) else { - throw ModelRegistry.Error.other(message: "type missing") - } - - guard let type = ModelRegistry.getType(for: parameterType, with: type) else { - throw ModelRegistry.Error.decoderErrorModelNotMapped() - } - return try type.decode(jsonDict: json) - } } extension KeyedDecodingContainer where Key: CodingKey {