bypass thread checks depending on location of Field call

This commit is contained in:
John Estropia
2020-02-21 11:52:11 +09:00
parent e1b03b4a89
commit 361dba58c6
8 changed files with 52 additions and 29 deletions

View File

@@ -172,10 +172,17 @@ extension CoreStoreObject {
switch child.value {
case let property as FieldAttributeProtocol:
attributes[property.keyPath] = type(of: property).read(field: property, for: object.rawObject!)
attributes[property.keyPath] = type(of: property).read(
field: property,
for: object.rawObject!,
bypassThreadCheck: false
)
case let property as FieldRelationshipProtocol:
attributes[property.keyPath] = type(of: property).valueForSnapshot(field: property, for: object.rawObject!)
attributes[property.keyPath] = type(of: property).valueForSnapshot(
field: property,
for: object.rawObject!
)
case let property as AttributeProtocol:
attributes[property.keyPath] = property.valueForSnapshot
@@ -212,7 +219,11 @@ extension CoreStoreObject {
switch property {
case let property as FieldAttributeProtocol:
values[property.keyPath] = type(of: property).read(field: property, for: rawObject)
values[property.keyPath] = type(of: property).read(
field: property,
for: rawObject,
bypassThreadCheck: false
)
default:
continue