diff --git a/MVMCoreUI/Atoms/Views/Label/LabelAttributeActionModel.swift b/MVMCoreUI/Atoms/Views/Label/LabelAttributeActionModel.swift index 135fee45..503f00d8 100644 --- a/MVMCoreUI/Atoms/Views/Label/LabelAttributeActionModel.swift +++ b/MVMCoreUI/Atoms/Views/Label/LabelAttributeActionModel.swift @@ -16,7 +16,11 @@ open class LabelAttributeActionModel: LabelAttributeModel { public init(_ location: Int, _ length: Int, action: ActionModelProtocol) { self.action = action - super.init(Self.identifier, location, length) + super.init(location, length) + } + + private enum CodingKeys: String, CodingKey { + case action } required public init(from decoder: Decoder) throws { @@ -30,8 +34,4 @@ open class LabelAttributeActionModel: LabelAttributeModel { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeModel(action, forKey: .action) } - - private enum CodingKeys: String, CodingKey { - case action - } } diff --git a/MVMCoreUI/Atoms/Views/Label/LabelAttributeModel.swift b/MVMCoreUI/Atoms/Views/Label/LabelAttributeModel.swift index 3c073b2f..437ec0cc 100644 --- a/MVMCoreUI/Atoms/Views/Label/LabelAttributeModel.swift +++ b/MVMCoreUI/Atoms/Views/Label/LabelAttributeModel.swift @@ -25,12 +25,14 @@ import Foundation return "" } - var type: String + var type: String { + get { return Self.identifier } + } + var location: Int var length: Int - init(_ type: String, _ location: Int, _ length: Int) { - self.type = type + init(_ location: Int, _ length: Int) { self.location = location self.length = length } @@ -51,7 +53,6 @@ import Foundation required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - type = try typeContainer.decode(String.self, forKey: .type) location = try typeContainer.decode(Int.self, forKey: .location) length = try typeContainer.decode(Int.self, forKey: .length) }