mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-23 09:51:30 +01:00
WIP: broken generics
This commit is contained in:
@@ -38,10 +38,10 @@ public extension NSManagedObject {
|
||||
- returns: the primitive value for the KVC key
|
||||
*/
|
||||
@nonobjc
|
||||
public func accessValueForKVCKey(_ KVCKey: KeyPath) -> AnyObject? {
|
||||
public func accessValueForKVCKey(_ KVCKey: KeyPath) -> Any? {
|
||||
|
||||
self.willAccessValue(forKey: KVCKey)
|
||||
let primitiveValue: AnyObject? = self.primitiveValue(forKey: KVCKey)
|
||||
let primitiveValue: Any? = self.primitiveValue(forKey: KVCKey)
|
||||
self.didAccessValue(forKey: KVCKey)
|
||||
|
||||
return primitiveValue
|
||||
@@ -54,7 +54,7 @@ public extension NSManagedObject {
|
||||
- parameter KVCKey: the KVC key
|
||||
*/
|
||||
@nonobjc
|
||||
public func setValue(_ value: AnyObject?, forKVCKey KVCKey: KeyPath) {
|
||||
public func setValue(_ value: Any?, forKVCKey KVCKey: KeyPath) {
|
||||
|
||||
self.willChangeValue(forKey: KVCKey)
|
||||
self.setPrimitiveValue(value, forKey: KVCKey)
|
||||
|
||||
@@ -79,7 +79,8 @@ public extension Progress {
|
||||
private final class ProgressObserver: NSObject {
|
||||
|
||||
private unowned let progress: Progress
|
||||
private var progressHandler: ((_ progress: Progress) -> Void)? {
|
||||
|
||||
fileprivate var progressHandler: ((_ progress: Progress) -> Void)? {
|
||||
|
||||
didSet {
|
||||
|
||||
@@ -105,7 +106,7 @@ private final class ProgressObserver: NSObject {
|
||||
}
|
||||
}
|
||||
|
||||
private init(_ progress: Progress) {
|
||||
fileprivate init(_ progress: Progress) {
|
||||
|
||||
self.progress = progress
|
||||
super.init()
|
||||
@@ -120,7 +121,7 @@ private final class ProgressObserver: NSObject {
|
||||
}
|
||||
}
|
||||
|
||||
override func observeValue(forKeyPath keyPath: String?, of object: AnyObject?, change: [NSKeyValueChangeKey : AnyObject]?, context: UnsafeMutablePointer<Void>?) {
|
||||
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
|
||||
|
||||
guard let progress = object as? Progress,
|
||||
progress == self.progress,
|
||||
@@ -131,7 +132,7 @@ private final class ProgressObserver: NSObject {
|
||||
|
||||
DispatchQueue.main.async { [weak self] () -> Void in
|
||||
|
||||
self?.progressHandler?(progress: progress)
|
||||
self?.progressHandler?(progress)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user