refactor
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
0c474a2764
commit
02973badbd
@ -14,7 +14,7 @@ open class BadgeIndicatorModel: MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Properties
|
||||
//--------------------------------------------------
|
||||
public static var identifier: String = "badgeIndicator"
|
||||
public static var identifier: String { "badgeIndicator" }
|
||||
public var id: String = UUID().uuidString
|
||||
public var backgroundColor: Color?
|
||||
|
||||
@ -64,8 +64,8 @@ open class BadgeIndicatorModel: MoleculeModelProtocol {
|
||||
}
|
||||
|
||||
required public convenience init(from decoder: Decoder) throws {
|
||||
self.init()
|
||||
let container = try decoder.container(keyedBy: CodingKeys.self)
|
||||
self.init()
|
||||
id = try container.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
|
||||
inverted = try container.decodeIfPresent(Bool.self, forKey: .inverted) ?? false
|
||||
accessibilityText = try container.decodeIfPresent(String.self, forKey: .accessibilityText)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user