changed comment.
This commit is contained in:
parent
2d0377acfc
commit
84462a197e
@ -9,16 +9,9 @@
|
|||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Use case:
|
UIColor is not supported by Codable. This Color class
|
||||||
For the Codable model define a variable such as:
|
effectively turns UIColor into a primitive class like
|
||||||
var color: UIColor
|
Int and String and can be used the same.
|
||||||
|
|
||||||
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 {
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user