From 1b99abdb6e3e519455160ccd599a9f35d57ff03f Mon Sep 17 00:00:00 2001 From: "Suresh, Kamlesh" Date: Tue, 19 Nov 2019 15:37:53 -0500 Subject: [PATCH] fixes --- MVMCore/MVMCore/Models/Model/ModelRegistry.swift | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/MVMCore/MVMCore/Models/Model/ModelRegistry.swift b/MVMCore/MVMCore/Models/Model/ModelRegistry.swift index 1089d61..05fbfa6 100644 --- a/MVMCore/MVMCore/Models/Model/ModelRegistry.swift +++ b/MVMCore/MVMCore/Models/Model/ModelRegistry.swift @@ -25,7 +25,7 @@ public struct ModelRegistry { } -extension KeyedDecodingContainer where Key : CodingKey{ +extension KeyedDecodingContainer where Key: CodingKey { private enum TypeCodingKey: String, CodingKey { case actionMap @@ -44,10 +44,6 @@ extension KeyedDecodingContainer where Key : CodingKey{ return m } - public func decode(codingKey: KeyedDecodingContainer.Key) throws -> ActionMapModel { - return try decode(codingKey: codingKey, typeCodingKey: TypeCodingKey.actionMap) - } - //MARK: - DecodeIfPresent public func decodeIfPresent(codingKey: KeyedDecodingContainer.Key, typeCodingKey: C) throws -> T? { @@ -73,14 +69,10 @@ extension KeyedDecodingContainer where Key : CodingKey{ } return m } - - public func decodeIfPresent(codingKey: KeyedDecodingContainer.Key) throws -> ActionMapModel? { - return try decodeIfPresent(codingKey: codingKey, typeCodingKey: TypeCodingKey.actionMap) - } } -extension KeyedEncodingContainer where Key : CodingKey { +extension KeyedEncodingContainer where Key: CodingKey { public mutating func encodeIfPresent(_ value: Model?, forKey key: KeyedEncodingContainer.Key) throws { if let v = value {