mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-18 06:57:15 +01:00
fix comments
This commit is contained in:
@@ -40,6 +40,15 @@ extension FieldContainer {
|
||||
|
||||
@Field.Coded("eyeColor", coder: FieldCoders.NSCoding.self)
|
||||
var eyeColor: UIColor = .black
|
||||
|
||||
@Field.Coded(
|
||||
"bloodType",
|
||||
coder: {
|
||||
encode: { $0.toData() },
|
||||
decode: { BloodType(fromData: $0) }
|
||||
}
|
||||
)
|
||||
var bloodType: BloodType = .unknown
|
||||
}
|
||||
```
|
||||
- Important: `Field` properties are required to be used as `@propertyWrapper`s. Any other declaration not using the `@Field.Stored(...) var` syntax will be ignored.
|
||||
@@ -94,8 +103,14 @@ extension FieldContainer {
|
||||
```
|
||||
class Person: CoreStoreObject {
|
||||
|
||||
@Field.Coded("eyeColor", coder: FieldCoders.NSCoding.self)
|
||||
var eyeColor: UIColor = .black
|
||||
@Field.Coded(
|
||||
"bloodType",
|
||||
coder: {
|
||||
encode: { $0.toData() },
|
||||
decode: { BloodType(fromData: $0) }
|
||||
}
|
||||
)
|
||||
var bloodType: BloodType = .unknown
|
||||
}
|
||||
```
|
||||
- parameter initial: the initial value for the property when the object is first created.
|
||||
@@ -416,8 +431,14 @@ extension FieldContainer.Coded where V: FieldOptionalType {
|
||||
```
|
||||
class Person: CoreStoreObject {
|
||||
|
||||
@Field.Coded("eyeColor", coder: FieldCoders.NSCoding.self)
|
||||
var eyeColor: UIColor? = nil
|
||||
@Field.Coded(
|
||||
"bloodType",
|
||||
coder: {
|
||||
encode: { $0.toData() },
|
||||
decode: { BloodType(fromData: $0) }
|
||||
}
|
||||
)
|
||||
var bloodType: BloodType?
|
||||
}
|
||||
```
|
||||
- parameter initial: the initial value for the property when the object is first created.
|
||||
|
||||
@@ -36,7 +36,7 @@ extension FieldContainer {
|
||||
/**
|
||||
The containing type for stored property values. Any type that conforms to `FieldStorableType` are supported.
|
||||
```
|
||||
class Animal: CoreStoreObject {
|
||||
class Person: CoreStoreObject {
|
||||
|
||||
@Field.Stored("title")
|
||||
var title: String = "Mr."
|
||||
|
||||
Reference in New Issue
Block a user