mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-07-06 21:05:14 +02:00
fix readme indentations
This commit is contained in:
@@ -1817,21 +1817,21 @@ The `@Field.Stored` property wrapper is used for persisted value types. This is
|
|||||||
<tr><th>Before</th><th>`@Field.Stored`</th></tr>
|
<tr><th>Before</th><th>`@Field.Stored`</th></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><pre lang=swift>
|
<td><pre lang=swift>
|
||||||
class Person: CoreStoreObject {
|
class Person: CoreStoreObject {
|
||||||
|
|
||||||
let title = Value.Required<String>("title", initial: "Mr.")
|
let title = Value.Required<String>("title", initial: "Mr.")
|
||||||
let nickname = Value.Optional<String>("nickname")
|
let nickname = Value.Optional<String>("nickname")
|
||||||
}
|
}
|
||||||
</pre></td>
|
</pre></td>
|
||||||
<td><pre lang=swift>
|
<td><pre lang=swift>
|
||||||
class Person: CoreStoreObject {
|
class Person: CoreStoreObject {
|
||||||
|
|
||||||
@Field.Stored("title")
|
@Field.Stored("title")
|
||||||
var title: String = "Mr."
|
var title: String = "Mr."
|
||||||
|
|
||||||
@Field.Stored("nickname")
|
@Field.Stored("nickname")
|
||||||
var nickname: String?
|
var nickname: String?
|
||||||
}
|
}
|
||||||
</pre></td>
|
</pre></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -1848,7 +1848,7 @@ The `@Field.Virtual` property wrapper is used for unsaved, computed value types.
|
|||||||
<tr><th>Before</th><th>`@Field.Virtual`</th></tr>
|
<tr><th>Before</th><th>`@Field.Virtual`</th></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><pre lang=swift>
|
<td><pre lang=swift>
|
||||||
class Animal: CoreStoreObject {
|
class Animal: CoreStoreObject {
|
||||||
|
|
||||||
let speciesPlural = Value.Required<String>(
|
let speciesPlural = Value.Required<String>(
|
||||||
"speciesPlural",
|
"speciesPlural",
|
||||||
@@ -1862,10 +1862,10 @@ class Animal: CoreStoreObject {
|
|||||||
let species = partialObject.value(for: { $0.species })
|
let species = partialObject.value(for: { $0.species })
|
||||||
return species + "s"
|
return species + "s"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</pre></td>
|
</pre></td>
|
||||||
<td><pre lang=swift>
|
<td><pre lang=swift>
|
||||||
class Animal: CoreStoreObject {
|
class Animal: CoreStoreObject {
|
||||||
|
|
||||||
@Field.Virtual(
|
@Field.Virtual(
|
||||||
"speciesPlural",
|
"speciesPlural",
|
||||||
@@ -1877,7 +1877,7 @@ class Animal: CoreStoreObject {
|
|||||||
|
|
||||||
@Field.Stored("species")
|
@Field.Stored("species")
|
||||||
var species: String = ""
|
var species: String = ""
|
||||||
}
|
}
|
||||||
</pre></td>
|
</pre></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -1896,17 +1896,17 @@ The `@Field.Coded` property wrapper is used for binary-codable values. This is t
|
|||||||
<tr><th>Before</th><th>`@Field.Coded`</th></tr>
|
<tr><th>Before</th><th>`@Field.Coded`</th></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><pre lang=swift>
|
<td><pre lang=swift>
|
||||||
class Vehicle: CoreStoreObject {
|
class Vehicle: CoreStoreObject {
|
||||||
|
|
||||||
let color = Transformable.Optional<UIColor>("color", initial: .white)
|
let color = Transformable.Optional<UIColor>("color", initial: .white)
|
||||||
}
|
}
|
||||||
</pre></td>
|
</pre></td>
|
||||||
<td><pre lang=swift>
|
<td><pre lang=swift>
|
||||||
class Vehicle: CoreStoreObject {
|
class Vehicle: CoreStoreObject {
|
||||||
|
|
||||||
@Field.Coded("color", coder: FieldCoders.NSCoding.self)
|
@Field.Coded("color", coder: FieldCoders.NSCoding.self)
|
||||||
var color: UIColor? = .white
|
var color: UIColor? = .white
|
||||||
}
|
}
|
||||||
</pre></td>
|
</pre></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -1949,26 +1949,26 @@ The type of relationship is determined by the `@Field.Relationship` generic typ
|
|||||||
<tr><th>Before</th><th>`@Field.Stored`</th></tr>
|
<tr><th>Before</th><th>`@Field.Stored`</th></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><pre lang=swift>
|
<td><pre lang=swift>
|
||||||
class Pet: CoreStoreObject {
|
class Pet: CoreStoreObject {
|
||||||
|
|
||||||
let master = Relationship.ToOne<Person>("master")
|
let master = Relationship.ToOne<Person>("master")
|
||||||
}
|
}
|
||||||
class Person: CoreStoreObject {
|
class Person: CoreStoreObject {
|
||||||
|
|
||||||
let pets: Relationship.ToManyUnordered<Pet>("pets", inverse: \.$master)
|
let pets: Relationship.ToManyUnordered<Pet>("pets", inverse: \.$master)
|
||||||
}
|
}
|
||||||
</pre></td>
|
</pre></td>
|
||||||
<td><pre lang=swift>
|
<td><pre lang=swift>
|
||||||
class Pet: CoreStoreObject {
|
class Pet: CoreStoreObject {
|
||||||
|
|
||||||
@Field.Relationship("master")
|
@Field.Relationship("master")
|
||||||
var master: Person?
|
var master: Person?
|
||||||
}
|
}
|
||||||
class Person: CoreStoreObject {
|
class Person: CoreStoreObject {
|
||||||
|
|
||||||
@Field.Relationship("pets", inverse: \.$master)
|
@Field.Relationship("pets", inverse: \.$master)
|
||||||
var pets: Set<Pet>
|
var pets: Set<Pet>
|
||||||
}
|
}
|
||||||
</pre></td>
|
</pre></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Reference in New Issue
Block a user