mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-14 21:23:43 +01:00
Merge branch 'develop'
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
protocol OrganismProtocol: class {
|
||||
protocol OrganismProtocol: AnyObject {
|
||||
|
||||
var dna: Int64 { get set }
|
||||
|
||||
|
||||
@@ -964,7 +964,7 @@ You can even use external types from popular 3rd-party JSON libraries, or just s
|
||||
#### `ImportableObject`
|
||||
`ImportableObject` is a very simple protocol:
|
||||
```swift
|
||||
public protocol ImportableObject: class {
|
||||
public protocol ImportableObject: AnyObject {
|
||||
typealias ImportSource
|
||||
static func shouldInsert(from source: ImportSource, in transaction: BaseDataTransaction) -> Bool
|
||||
func didInsert(from source: ImportSource, in transaction: BaseDataTransaction) throws
|
||||
|
||||
@@ -29,7 +29,7 @@ import CoreData
|
||||
|
||||
// MARK: - AttributeProtocol
|
||||
|
||||
internal protocol AttributeProtocol: class {
|
||||
internal protocol AttributeProtocol: AnyObject {
|
||||
|
||||
static var attributeType: NSAttributeType { get }
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ import CoreData
|
||||
*/
|
||||
@available(macOS 10.12, *)
|
||||
@objc
|
||||
public protocol CSListObserver: class {
|
||||
public protocol CSListObserver: AnyObject {
|
||||
|
||||
/**
|
||||
Handles processing just before a change to the observed list occurs
|
||||
|
||||
@@ -40,7 +40,7 @@ import CoreData
|
||||
*/
|
||||
@available(macOS 10.12, *)
|
||||
@objc
|
||||
public protocol CSObjectObserver: class {
|
||||
public protocol CSObjectObserver: AnyObject {
|
||||
|
||||
/**
|
||||
Handles processing just before a change to the observed `object` occurs
|
||||
|
||||
@@ -33,7 +33,7 @@ import CoreData
|
||||
Objective-C Foundation types that are natively supported by Core Data managed attributes all conform to `CoreDataNativeType`.
|
||||
*/
|
||||
@objc
|
||||
public protocol CoreDataNativeType: class, NSObjectProtocol {}
|
||||
public protocol CoreDataNativeType: AnyObject, NSObjectProtocol {}
|
||||
|
||||
|
||||
// MARK: - NSNumber
|
||||
|
||||
@@ -31,7 +31,7 @@ import Foundation
|
||||
/**
|
||||
`CoreStoreObjectiveCType`s are Objective-C accessible classes that represent CoreStore's Swift types.
|
||||
*/
|
||||
public protocol CoreStoreObjectiveCType: class {
|
||||
public protocol CoreStoreObjectiveCType: AnyObject {
|
||||
|
||||
/**
|
||||
The corresponding Swift type
|
||||
|
||||
@@ -34,7 +34,7 @@ import CoreData
|
||||
|
||||
`invalidate()` will be called automatically when an `CoreStoreObjectKeyValueObservation` is deinited.
|
||||
*/
|
||||
public protocol CoreStoreObjectKeyValueObservation: class {
|
||||
public protocol CoreStoreObjectKeyValueObservation: AnyObject {
|
||||
|
||||
/**
|
||||
`invalidate()` will be called automatically when an `CoreStoreObjectKeyValueObservation` is deinited.
|
||||
|
||||
@@ -32,7 +32,7 @@ import CoreData
|
||||
/**
|
||||
All CoreStore's utilities are designed around `DynamicObject` instances. `NSManagedObject` and `CoreStoreObject` instances all conform to `DynamicObject`.
|
||||
*/
|
||||
public protocol DynamicObject: class {
|
||||
public protocol DynamicObject: AnyObject {
|
||||
|
||||
/**
|
||||
Used internally by CoreStore. Do not call directly.
|
||||
|
||||
@@ -32,7 +32,7 @@ import CoreData
|
||||
/**
|
||||
Encapsulates containers which manages an internal `NSManagedObjectContext`, such as `DataStack`s and transactions, that can be used for fetching objects. CoreStore provides implementations for this protocol and should be used as a read-only abstraction.
|
||||
*/
|
||||
public protocol FetchableSource: class {
|
||||
public protocol FetchableSource: AnyObject {
|
||||
|
||||
/**
|
||||
Fetches the `DynamicObject` instance in the `FetchableSource`'s context from a reference created from another managed object context.
|
||||
|
||||
@@ -30,7 +30,7 @@ import CoreData
|
||||
// MARK: - FetchedResultsControllerHandler
|
||||
|
||||
@available(macOS 10.12, *)
|
||||
internal protocol FetchedResultsControllerHandler: class {
|
||||
internal protocol FetchedResultsControllerHandler: AnyObject {
|
||||
|
||||
func controller(_ controller: NSFetchedResultsController<NSFetchRequestResult>, didChangeObject anObject: Any, atIndexPath indexPath: IndexPath?, forChangeType type: NSFetchedResultsChangeType, newIndexPath: IndexPath?)
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ import CoreData
|
||||
```
|
||||
*/
|
||||
@available(macOS 10.12, *)
|
||||
public protocol ListObserver: class {
|
||||
public protocol ListObserver: AnyObject {
|
||||
|
||||
/**
|
||||
The `NSManagedObject` type for the observed list
|
||||
|
||||
@@ -37,7 +37,7 @@ import CoreData
|
||||
```
|
||||
*/
|
||||
@available(macOS 10.12, *)
|
||||
public protocol ObjectObserver: class {
|
||||
public protocol ObjectObserver: AnyObject {
|
||||
|
||||
/**
|
||||
The `DynamicObject` type for the observed object
|
||||
|
||||
@@ -32,7 +32,7 @@ import CoreData
|
||||
/**
|
||||
Encapsulates containers which manages an internal `NSManagedObjectContext`, such as `DataStack`s and transactions, that can be used for querying values. CoreStore provides implementations for this protocol and should be used as a read-only abstraction.
|
||||
*/
|
||||
public protocol QueryableSource: class {
|
||||
public protocol QueryableSource: AnyObject {
|
||||
|
||||
/**
|
||||
Queries aggregate values as specified by the `QueryClause`s. Requires at least a `Select` clause, and optional `Where`, `OrderBy`, `GroupBy`, and `Tweak` clauses.
|
||||
|
||||
@@ -29,7 +29,7 @@ import CoreData
|
||||
|
||||
// MARK: - RelationshipProtocol
|
||||
|
||||
internal protocol RelationshipProtocol: class {
|
||||
internal protocol RelationshipProtocol: AnyObject {
|
||||
|
||||
var keyPath: KeyPathString { get }
|
||||
var isToMany: Bool { get }
|
||||
|
||||
@@ -31,7 +31,7 @@ import CoreData
|
||||
/**
|
||||
The `StorageInterface` represents the data store managed (or to be managed) by the `DataStack`. When added to the `DataStack`, the `StorageInterface` serves as the interface for the `NSPersistentStore`. This may be a database file, an in-memory store, etc.
|
||||
*/
|
||||
public protocol StorageInterface: class {
|
||||
public protocol StorageInterface: AnyObject {
|
||||
|
||||
/**
|
||||
The string identifier for the `NSPersistentStore`'s `type` property. This is the same string CoreStore will use to create the `NSPersistentStore` from the `NSPersistentStoreCoordinator`'s `addPersistentStoreWithType(...)` method.
|
||||
|
||||
Reference in New Issue
Block a user