mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-04-21 08:21:21 +02:00
fix casting issues
This commit is contained in:
@@ -43,5 +43,5 @@ internal protocol AttributeProtocol: PropertyProtocol {
|
|||||||
var rawObject: CoreStoreManagedObject? { get set }
|
var rawObject: CoreStoreManagedObject? { get set }
|
||||||
var getter: CoreStoreManagedObject.CustomGetter? { get }
|
var getter: CoreStoreManagedObject.CustomGetter? { get }
|
||||||
var setter: CoreStoreManagedObject.CustomSetter? { get }
|
var setter: CoreStoreManagedObject.CustomSetter? { get }
|
||||||
var valueForSnapshot: Any { get }
|
var valueForSnapshot: Any? { get }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ extension DiffableDataSource {
|
|||||||
|
|
||||||
let diffableSnapshot = snapshot.diffableSnapshot
|
let diffableSnapshot = snapshot.diffableSnapshot
|
||||||
self.dispatcher.apply(
|
self.dispatcher.apply(
|
||||||
diffableSnapshot as! Internals.DiffableDataSourceSnapshot,
|
diffableSnapshot,
|
||||||
view: self.collectionView,
|
view: self.collectionView,
|
||||||
animatingDifferences: animatingDifferences,
|
animatingDifferences: animatingDifferences,
|
||||||
performUpdates: { collectionView, changeset, setSections in
|
performUpdates: { collectionView, changeset, setSections in
|
||||||
|
|||||||
@@ -356,7 +356,7 @@ extension ObjectPublisher where O: NSManagedObject {
|
|||||||
public func value<V: AllowedObjectiveCKeyPathValue>(forKeyPath keyPath: KeyPath<O, V>) -> V! {
|
public func value<V: AllowedObjectiveCKeyPathValue>(forKeyPath keyPath: KeyPath<O, V>) -> V! {
|
||||||
|
|
||||||
let key = String(keyPath: keyPath)
|
let key = String(keyPath: keyPath)
|
||||||
return self.snapshot?.dictionaryForValues()[key] as? V
|
return self.snapshot?.dictionaryForValues()[key] as! V?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ extension ObjectSnapshot where O: NSManagedObject {
|
|||||||
public func value<V: AllowedObjectiveCKeyPathValue>(forKeyPath keyPath: KeyPath<O, V>) -> V! {
|
public func value<V: AllowedObjectiveCKeyPathValue>(forKeyPath keyPath: KeyPath<O, V>) -> V! {
|
||||||
|
|
||||||
let key = String(keyPath: keyPath)
|
let key = String(keyPath: keyPath)
|
||||||
return self.values[key] as? V
|
return self.values[key] as! V?
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ public struct PartialObject<O: CoreStoreObject> {
|
|||||||
*/
|
*/
|
||||||
public func value<V>(for property: (O) -> TransformableContainer<O>.Optional<V>) -> V? {
|
public func value<V>(for property: (O) -> TransformableContainer<O>.Optional<V>) -> V? {
|
||||||
|
|
||||||
return self.rawObject.value(forKey: property(O.meta).keyPath) as? V
|
return self.rawObject.value(forKey: property(O.meta).keyPath) as! V?
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -212,7 +212,7 @@ public struct PartialObject<O: CoreStoreObject> {
|
|||||||
*/
|
*/
|
||||||
public func primitiveValue<V>(for property: (O) -> TransformableContainer<O>.Optional<V>) -> V? {
|
public func primitiveValue<V>(for property: (O) -> TransformableContainer<O>.Optional<V>) -> V? {
|
||||||
|
|
||||||
return self.rawObject.primitiveValue(forKey: property(O.meta).keyPath) as? V
|
return self.rawObject.primitiveValue(forKey: property(O.meta).keyPath) as! V?
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -313,9 +313,9 @@ public enum RelationshipContainer<O: CoreStoreObject> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal var valueForSnapshot: Any {
|
internal var valueForSnapshot: Any? {
|
||||||
|
|
||||||
return self.value?.objectID() as Any
|
return self.value?.objectID()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -609,9 +609,9 @@ public enum RelationshipContainer<O: CoreStoreObject> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal var valueForSnapshot: Any {
|
internal var valueForSnapshot: Any? {
|
||||||
|
|
||||||
return self.value.map({ $0.objectID() }) as Any
|
return self.value.map({ $0.objectID() })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -910,9 +910,9 @@ public enum RelationshipContainer<O: CoreStoreObject> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal var valueForSnapshot: Any {
|
internal var valueForSnapshot: Any? {
|
||||||
|
|
||||||
return Set(self.value.map({ $0.objectID() })) as Any
|
return Set(self.value.map({ $0.objectID() }))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -41,5 +41,5 @@ internal protocol RelationshipProtocol: PropertyProtocol {
|
|||||||
var renamingIdentifier: () -> String? { get }
|
var renamingIdentifier: () -> String? { get }
|
||||||
var minCount: Int { get }
|
var minCount: Int { get }
|
||||||
var maxCount: Int { get }
|
var maxCount: Int { get }
|
||||||
var valueForSnapshot: Any { get }
|
var valueForSnapshot: Any? { get }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -272,9 +272,9 @@ public enum TransformableContainer<O: CoreStoreObject> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal var valueForSnapshot: Any {
|
internal var valueForSnapshot: Any? {
|
||||||
|
|
||||||
return self.value as Any
|
return self.value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -380,7 +380,7 @@ public enum TransformableContainer<O: CoreStoreObject> {
|
|||||||
|
|
||||||
return customGetter(PartialObject<O>(object))
|
return customGetter(PartialObject<O>(object))
|
||||||
}
|
}
|
||||||
return object.value(forKey: self.keyPath) as? V
|
return object.value(forKey: self.keyPath) as! V?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
@@ -489,14 +489,14 @@ public enum TransformableContainer<O: CoreStoreObject> {
|
|||||||
}
|
}
|
||||||
customSetter(
|
customSetter(
|
||||||
PartialObject<O>(rawObject),
|
PartialObject<O>(rawObject),
|
||||||
newValue as? V
|
newValue as! V?
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal var valueForSnapshot: Any {
|
internal var valueForSnapshot: Any? {
|
||||||
|
|
||||||
return self.value as Any
|
return self.value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -267,9 +267,9 @@ public enum ValueContainer<O: CoreStoreObject> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal var valueForSnapshot: Any {
|
internal var valueForSnapshot: Any? {
|
||||||
|
|
||||||
return self.value as Any
|
return self.value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -489,9 +489,9 @@ public enum ValueContainer<O: CoreStoreObject> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal var valueForSnapshot: Any {
|
internal var valueForSnapshot: Any? {
|
||||||
|
|
||||||
return self.value as Any
|
return self.value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user