changed comment.
This commit is contained in:
parent
2d0377acfc
commit
84462a197e
@ -9,16 +9,9 @@
|
||||
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)
|
||||
|
||||
UIColor is not supported by Codable. This Color class
|
||||
effectively turns UIColor into a primitive class like
|
||||
Int and String and can be used the same.
|
||||
*/
|
||||
public final class Color: Codable {
|
||||
//--------------------------------------------------
|
||||
|
||||
Loading…
Reference in New Issue
Block a user