fix after tetsing

This commit is contained in:
Khan, Arshad 2020-12-15 22:52:38 +05:30
parent 09b263fa23
commit 77993736be

View File

@ -24,12 +24,14 @@ public class NavigationImageButtonModel: NavigationButtonModelProtocol, Molecule
case image
case action
case moleculeName
case accessibilityText
}
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
image = try typeContainer.decode(String.self, forKey: .image)
action = try typeContainer.decodeModel(codingKey: .action)
accessibilityText = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityText)
}
open func encode(to encoder: Encoder) throws {
@ -37,6 +39,7 @@ public class NavigationImageButtonModel: NavigationButtonModelProtocol, Molecule
try container.encode(image, forKey: .image)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeModel(action, forKey: .action)
try container.encodeIfPresent(accessibilityText, forKey: .accessibilityText)
}
/// Convenience function that creates a BarButtonItem for the model.