FieldCoderType
public protocol FieldCoderType
Types that implement encoding to and decoding from Data
to be used in Field.Coded
properties’ coder:
argument.
class Person: CoreStoreObject {
@Field.Coded("profile", coder: FieldCoders.Json.self)
var profile: Profile = .init()
}
-
The type to encode to and decode from
Data
Declaration
Swift
associatedtype FieldStoredValue
-
Encodes the value to
Data
Declaration
Swift
static func encodeToStoredData(_ fieldValue: FieldStoredValue?) -> Data?
-
Decodes the value from
Data
Declaration
Swift
static func decodeFromStoredData(_ data: Data?) -> FieldStoredValue?