Explaining use case of Color.
This commit is contained in:
parent
79f15fd706
commit
2abd6a866a
@ -8,7 +8,19 @@
|
|||||||
|
|
||||||
import UIKit
|
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 {
|
public final class Color: Codable {
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Properties
|
// MARK: - Properties
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user