From 2abd6a866a6502d98e31e30e64f7a0b171aa7ec9 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Wed, 8 Jan 2020 09:28:54 -0500 Subject: [PATCH] Explaining use case of Color. --- MVMCoreUI/Models/Primitive Models/Color.swift | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/Models/Primitive Models/Color.swift b/MVMCoreUI/Models/Primitive Models/Color.swift index 027b826e..55740fa0 100644 --- a/MVMCoreUI/Models/Primitive Models/Color.swift +++ b/MVMCoreUI/Models/Primitive Models/Color.swift @@ -8,7 +8,19 @@ import UIKit - +/* + Use case: + For the Codable model define a variable such as + + var color: UIColor + + In the decode initializer: + color = try typeContainer.decode(Color.self, forKey: .color).uiColor + + In the encode initializer: + try container.encodeIfPresent(Color(uiColor: color), forKey: .color) + + */ public final class Color: Codable { //-------------------------------------------------- // MARK: - Properties