diff --git a/Sources/ObjectiveC/CSAsynchronousDataTransaction.swift b/Sources/ObjectiveC/CSAsynchronousDataTransaction.swift index fdf5358..f31609d 100644 --- a/Sources/ObjectiveC/CSAsynchronousDataTransaction.swift +++ b/Sources/ObjectiveC/CSAsynchronousDataTransaction.swift @@ -87,7 +87,7 @@ public final class CSAsynchronousDataTransaction: CSBaseDataTransaction { - returns: a new `NSManagedObject` instance of the specified entity type. */ @objc - public override func createInto(into: CSInto) -> NSManagedObject { + public override func createInto(into: CSInto) -> AnyObject { return self.bridgeToSwift.create(into.bridgeToSwift) } @@ -100,7 +100,7 @@ public final class CSAsynchronousDataTransaction: CSBaseDataTransaction { */ @objc @warn_unused_result - public override func editObject(object: NSManagedObject?) -> NSManagedObject? { + public override func editObject(object: NSManagedObject?) -> AnyObject? { return self.bridgeToSwift.edit(object) } @@ -114,7 +114,7 @@ public final class CSAsynchronousDataTransaction: CSBaseDataTransaction { */ @objc @warn_unused_result - public override func editInto(into: CSInto, objectID: NSManagedObjectID) -> NSManagedObject? { + public override func editInto(into: CSInto, objectID: NSManagedObjectID) -> AnyObject? { return self.bridgeToSwift.edit(into.bridgeToSwift, objectID) } diff --git a/Sources/ObjectiveC/CSBaseDataTransaction+Querying.swift b/Sources/ObjectiveC/CSBaseDataTransaction+Querying.swift index 7819423..415587e 100644 --- a/Sources/ObjectiveC/CSBaseDataTransaction+Querying.swift +++ b/Sources/ObjectiveC/CSBaseDataTransaction+Querying.swift @@ -39,7 +39,7 @@ public extension CSBaseDataTransaction { */ @objc @warn_unused_result - public func fetchExistingObject(object: NSManagedObject) -> NSManagedObject? { + public func fetchExistingObject(object: NSManagedObject) -> AnyObject? { do { @@ -59,7 +59,7 @@ public extension CSBaseDataTransaction { */ @objc @warn_unused_result - public func fetchExistingObjectWithID(objectID: NSManagedObjectID) -> NSManagedObject? { + public func fetchExistingObjectWithID(objectID: NSManagedObjectID) -> AnyObject? { do { @@ -106,7 +106,7 @@ public extension CSBaseDataTransaction { */ @objc @warn_unused_result - public func fetchOneFrom(from: CSFrom, fetchClauses: [CSFetchClause]) -> NSManagedObject? { + public func fetchOneFrom(from: CSFrom, fetchClauses: [CSFetchClause]) -> AnyObject? { CoreStore.assert( self.bridgeToSwift.isRunningInAllowedQueue(), diff --git a/Sources/ObjectiveC/CSBaseDataTransaction.swift b/Sources/ObjectiveC/CSBaseDataTransaction.swift index 44be17a..2362ab2 100644 --- a/Sources/ObjectiveC/CSBaseDataTransaction.swift +++ b/Sources/ObjectiveC/CSBaseDataTransaction.swift @@ -55,7 +55,7 @@ public class CSBaseDataTransaction: NSObject, CoreStoreObjectiveCType { - returns: a new `NSManagedObject` instance of the specified entity type. */ @objc - public func createInto(into: CSInto) -> NSManagedObject { + public func createInto(into: CSInto) -> AnyObject { return self.bridgeToSwift.create(into.bridgeToSwift) } @@ -68,7 +68,7 @@ public class CSBaseDataTransaction: NSObject, CoreStoreObjectiveCType { */ @objc @warn_unused_result - public func editObject(object: NSManagedObject?) -> NSManagedObject? { + public func editObject(object: NSManagedObject?) -> AnyObject? { return self.bridgeToSwift.edit(object) } @@ -82,7 +82,7 @@ public class CSBaseDataTransaction: NSObject, CoreStoreObjectiveCType { */ @objc @warn_unused_result - public func editInto(into: CSInto, objectID: NSManagedObjectID) -> NSManagedObject? { + public func editInto(into: CSInto, objectID: NSManagedObjectID) -> AnyObject? { return self.bridgeToSwift.edit(into.bridgeToSwift, objectID) } diff --git a/Sources/ObjectiveC/CSCoreStore+Querying.swift b/Sources/ObjectiveC/CSCoreStore+Querying.swift index 2270a7c..9128a61 100644 --- a/Sources/ObjectiveC/CSCoreStore+Querying.swift +++ b/Sources/ObjectiveC/CSCoreStore+Querying.swift @@ -39,7 +39,7 @@ public extension CSCoreStore { */ @objc @warn_unused_result - public static func fetchExistingObject(object: NSManagedObject) -> NSManagedObject? { + public static func fetchExistingObject(object: NSManagedObject) -> AnyObject? { return self.defaultStack.fetchExistingObject(object) } @@ -52,7 +52,7 @@ public extension CSCoreStore { */ @objc @warn_unused_result - public static func fetchExistingObjectWithID(objectID: NSManagedObjectID) -> NSManagedObject? { + public static func fetchExistingObjectWithID(objectID: NSManagedObjectID) -> AnyObject? { return self.defaultStack.fetchExistingObjectWithID(objectID) } @@ -92,7 +92,7 @@ public extension CSCoreStore { */ @objc @warn_unused_result - public static func fetchOneFrom(from: CSFrom, fetchClauses: [CSFetchClause]) -> NSManagedObject? { + public static func fetchOneFrom(from: CSFrom, fetchClauses: [CSFetchClause]) -> AnyObject? { return self.defaultStack.fetchOneFrom(from, fetchClauses: fetchClauses) } diff --git a/Sources/ObjectiveC/CSDataStack+Querying.swift b/Sources/ObjectiveC/CSDataStack+Querying.swift index 9e70e39..3e66549 100644 --- a/Sources/ObjectiveC/CSDataStack+Querying.swift +++ b/Sources/ObjectiveC/CSDataStack+Querying.swift @@ -39,7 +39,7 @@ public extension CSDataStack { */ @objc @warn_unused_result - public func fetchExistingObject(object: NSManagedObject) -> NSManagedObject? { + public func fetchExistingObject(object: NSManagedObject) -> AnyObject? { do { @@ -59,7 +59,7 @@ public extension CSDataStack { */ @objc @warn_unused_result - public func fetchExistingObjectWithID(objectID: NSManagedObjectID) -> NSManagedObject? { + public func fetchExistingObjectWithID(objectID: NSManagedObjectID) -> AnyObject? { do { @@ -106,7 +106,7 @@ public extension CSDataStack { */ @objc @warn_unused_result - public func fetchOneFrom(from: CSFrom, fetchClauses: [CSFetchClause]) -> NSManagedObject? { + public func fetchOneFrom(from: CSFrom, fetchClauses: [CSFetchClause]) -> AnyObject? { CoreStore.assert( NSThread.isMainThread(), diff --git a/Sources/ObjectiveC/CSListMonitor.swift b/Sources/ObjectiveC/CSListMonitor.swift index 5a83a73..b393772 100644 --- a/Sources/ObjectiveC/CSListMonitor.swift +++ b/Sources/ObjectiveC/CSListMonitor.swift @@ -47,7 +47,7 @@ public final class CSListMonitor: NSObject, CoreStoreObjectiveCType { - returns: the `NSManagedObject` at the specified index */ @objc - public subscript(index: Int) -> NSManagedObject { + public subscript(index: Int) -> AnyObject { return self.bridgeToSwift[index] } @@ -59,7 +59,7 @@ public final class CSListMonitor: NSObject, CoreStoreObjectiveCType { - returns: the `NSManagedObject` at the specified index, or `nil` if out of bounds */ @objc - public func objectAtSafeIndex(index: Int) -> NSManagedObject? { + public func objectAtSafeIndex(index: Int) -> AnyObject? { return self.bridgeToSwift[safeIndex: index] } @@ -72,7 +72,7 @@ public final class CSListMonitor: NSObject, CoreStoreObjectiveCType { - returns: the `NSManagedObject` at the specified section and item index */ @objc - public func objectAtSectionIndex(sectionIndex: Int, itemIndex: Int) -> NSManagedObject { + public func objectAtSectionIndex(sectionIndex: Int, itemIndex: Int) -> AnyObject { return self.bridgeToSwift[sectionIndex, itemIndex] } @@ -85,7 +85,7 @@ public final class CSListMonitor: NSObject, CoreStoreObjectiveCType { - returns: the `NSManagedObject` at the specified section and item index, or `nil` if out of bounds */ @objc - public func objectAtSafeSectionIndex(sectionIndex: Int, safeItemIndex itemIndex: Int) -> NSManagedObject? { + public func objectAtSafeSectionIndex(sectionIndex: Int, safeItemIndex itemIndex: Int) -> AnyObject? { return self.bridgeToSwift[safeSectionIndex: sectionIndex, safeItemIndex: itemIndex] } @@ -97,7 +97,7 @@ public final class CSListMonitor: NSObject, CoreStoreObjectiveCType { - returns: the `NSManagedObject` at the specified index path */ @objc - public func objectAtIndexPath(indexPath: NSIndexPath) -> NSManagedObject { + public func objectAtIndexPath(indexPath: NSIndexPath) -> AnyObject { return self.bridgeToSwift[indexPath] } @@ -109,7 +109,7 @@ public final class CSListMonitor: NSObject, CoreStoreObjectiveCType { - returns: the `NSManagedObject` at the specified index path, or `nil` if out of bounds */ @objc - public func objectAtSafeIndexPath(indexPath: NSIndexPath) -> NSManagedObject? { + public func objectAtSafeIndexPath(indexPath: NSIndexPath) -> AnyObject? { return self.bridgeToSwift[safeIndexPath: indexPath] } diff --git a/Sources/ObjectiveC/CSListObserver.swift b/Sources/ObjectiveC/CSListObserver.swift index f59909d..9800d30 100644 --- a/Sources/ObjectiveC/CSListObserver.swift +++ b/Sources/ObjectiveC/CSListObserver.swift @@ -103,7 +103,7 @@ public protocol CSListObjectObserver: CSListObserver { - parameter indexPath: the new `NSIndexPath` for the inserted object */ @objc - optional func listMonitor(monitor: CSListMonitor, didInsertObject object: NSManagedObject, toIndexPath indexPath: NSIndexPath) + optional func listMonitor(monitor: CSListMonitor, didInsertObject object: AnyObject, toIndexPath indexPath: NSIndexPath) /** Notifies that an object was deleted from the specified `NSIndexPath` in the list @@ -113,7 +113,7 @@ public protocol CSListObjectObserver: CSListObserver { - parameter indexPath: the `NSIndexPath` for the deleted object */ @objc - optional func listMonitor(monitor: CSListMonitor, didDeleteObject object: NSManagedObject, fromIndexPath indexPath: NSIndexPath) + optional func listMonitor(monitor: CSListMonitor, didDeleteObject object: AnyObject, fromIndexPath indexPath: NSIndexPath) /** Notifies that an object at the specified `NSIndexPath` was updated @@ -123,7 +123,7 @@ public protocol CSListObjectObserver: CSListObserver { - parameter indexPath: the `NSIndexPath` for the updated object */ @objc - optional func listMonitor(monitor: CSListMonitor, didUpdateObject object: NSManagedObject, atIndexPath indexPath: NSIndexPath) + optional func listMonitor(monitor: CSListMonitor, didUpdateObject object: AnyObject, atIndexPath indexPath: NSIndexPath) /** Notifies that an object's index changed @@ -134,7 +134,7 @@ public protocol CSListObjectObserver: CSListObserver { - parameter toIndexPath: the new `NSIndexPath` for the moved object */ @objc - optional func listMonitor(monitor: CSListMonitor, didMoveObject object: NSManagedObject, fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) + optional func listMonitor(monitor: CSListMonitor, didMoveObject object: AnyObject, fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) } diff --git a/Sources/ObjectiveC/CSObjectMonitor.swift b/Sources/ObjectiveC/CSObjectMonitor.swift index 72a3476..9be2891 100644 --- a/Sources/ObjectiveC/CSObjectMonitor.swift +++ b/Sources/ObjectiveC/CSObjectMonitor.swift @@ -41,7 +41,7 @@ public final class CSObjectMonitor: NSObject, CoreStoreObjectiveCType { /** Returns the `NSManagedObject` instance being observed, or `nil` if the object was already deleted. */ - public var object: NSManagedObject? { + public var object: AnyObject? { return self.bridgeToSwift.object } diff --git a/Sources/ObjectiveC/CSObjectObserver.swift b/Sources/ObjectiveC/CSObjectObserver.swift index 46eba1f..8338949 100644 --- a/Sources/ObjectiveC/CSObjectObserver.swift +++ b/Sources/ObjectiveC/CSObjectObserver.swift @@ -49,7 +49,7 @@ public protocol CSObjectObserver: class, AnyObject { - parameter object: the `NSManagedObject` instance being observed */ @objc - optional func objectMonitor(monitor: CSObjectMonitor, willUpdateObject object: NSManagedObject) + optional func objectMonitor(monitor: CSObjectMonitor, willUpdateObject object: AnyObject) /** Handles processing right after a change to the observed `object` occurs @@ -59,7 +59,7 @@ public protocol CSObjectObserver: class, AnyObject { - parameter changedPersistentKeys: an `NSSet` of key paths for the attributes that were changed. Note that `changedPersistentKeys` only contains keys for attributes/relationships present in the persistent store, thus transient properties will not be reported. */ @objc - optional func objectMonitor(monitor: CSObjectMonitor, didUpdateObject object: NSManagedObject, changedPersistentKeys: Set) + optional func objectMonitor(monitor: CSObjectMonitor, didUpdateObject object: AnyObject, changedPersistentKeys: Set) /** Handles processing right after `object` is deleted @@ -68,5 +68,5 @@ public protocol CSObjectObserver: class, AnyObject { - parameter object: the `NSManagedObject` instance being observed */ @objc - optional func objectMonitor(monitor: CSObjectMonitor, didDeleteObject object: NSManagedObject) + optional func objectMonitor(monitor: CSObjectMonitor, didDeleteObject object: AnyObject) } diff --git a/Sources/ObjectiveC/CSSynchronousDataTransaction.swift b/Sources/ObjectiveC/CSSynchronousDataTransaction.swift index cccb2d9..166e75f 100644 --- a/Sources/ObjectiveC/CSSynchronousDataTransaction.swift +++ b/Sources/ObjectiveC/CSSynchronousDataTransaction.swift @@ -87,7 +87,7 @@ public final class CSSynchronousDataTransaction: CSBaseDataTransaction { - returns: a new `NSManagedObject` instance of the specified entity type. */ @objc - public override func createInto(into: CSInto) -> NSManagedObject { + public override func createInto(into: CSInto) -> AnyObject { return self.bridgeToSwift.create(into.bridgeToSwift) } @@ -100,7 +100,7 @@ public final class CSSynchronousDataTransaction: CSBaseDataTransaction { */ @objc @warn_unused_result - public override func editObject(object: NSManagedObject?) -> NSManagedObject? { + public override func editObject(object: NSManagedObject?) -> AnyObject? { return self.bridgeToSwift.edit(object) } @@ -114,7 +114,7 @@ public final class CSSynchronousDataTransaction: CSBaseDataTransaction { */ @objc @warn_unused_result - public override func editInto(into: CSInto, objectID: NSManagedObjectID) -> NSManagedObject? { + public override func editInto(into: CSInto, objectID: NSManagedObjectID) -> AnyObject? { return self.bridgeToSwift.edit(into.bridgeToSwift, objectID) }