mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-04-21 16:31:21 +02:00
tidy up
This commit is contained in:
@@ -206,6 +206,7 @@
|
|||||||
B56321B61BD6521C006C9394 /* WeakObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F2D1AFF849C0064E85B /* WeakObject.swift */; };
|
B56321B61BD6521C006C9394 /* WeakObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E84F2D1AFF849C0064E85B /* WeakObject.swift */; };
|
||||||
B56964D41B22FFAD0075EE4A /* DataStack+Migration.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56964D31B22FFAD0075EE4A /* DataStack+Migration.swift */; };
|
B56964D41B22FFAD0075EE4A /* DataStack+Migration.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56964D31B22FFAD0075EE4A /* DataStack+Migration.swift */; };
|
||||||
B56965241B356B820075EE4A /* MigrationResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56965231B356B820075EE4A /* MigrationResult.swift */; };
|
B56965241B356B820075EE4A /* MigrationResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56965231B356B820075EE4A /* MigrationResult.swift */; };
|
||||||
|
B59AFF411C6593E400C0ABE2 /* NSPersistentStoreCoordinator+Setup.swift in Sources */ = {isa = PBXBuildFile; fileRef = B59AFF401C6593E400C0ABE2 /* NSPersistentStoreCoordinator+Setup.swift */; };
|
||||||
B59D5C221B5BA34B00453479 /* NSFileManager+Setup.swift in Sources */ = {isa = PBXBuildFile; fileRef = B59D5C211B5BA34B00453479 /* NSFileManager+Setup.swift */; };
|
B59D5C221B5BA34B00453479 /* NSFileManager+Setup.swift in Sources */ = {isa = PBXBuildFile; fileRef = B59D5C211B5BA34B00453479 /* NSFileManager+Setup.swift */; };
|
||||||
B5A261211B64BFDB006EB6D3 /* MigrationType.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5A261201B64BFDB006EB6D3 /* MigrationType.swift */; };
|
B5A261211B64BFDB006EB6D3 /* MigrationType.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5A261201B64BFDB006EB6D3 /* MigrationType.swift */; };
|
||||||
B5C976E31C6C9F6A00B1AF90 /* UnsafeDataTransaction+Observing.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5C976E21C6C9F6A00B1AF90 /* UnsafeDataTransaction+Observing.swift */; };
|
B5C976E31C6C9F6A00B1AF90 /* UnsafeDataTransaction+Observing.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5C976E21C6C9F6A00B1AF90 /* UnsafeDataTransaction+Observing.swift */; };
|
||||||
@@ -319,6 +320,7 @@
|
|||||||
B563217B1BD650E3006C9394 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/WatchOS.platform/Developer/SDKs/WatchOS2.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
|
B563217B1BD650E3006C9394 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/WatchOS.platform/Developer/SDKs/WatchOS2.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
|
||||||
B56964D31B22FFAD0075EE4A /* DataStack+Migration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DataStack+Migration.swift"; sourceTree = "<group>"; };
|
B56964D31B22FFAD0075EE4A /* DataStack+Migration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DataStack+Migration.swift"; sourceTree = "<group>"; };
|
||||||
B56965231B356B820075EE4A /* MigrationResult.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MigrationResult.swift; sourceTree = "<group>"; };
|
B56965231B356B820075EE4A /* MigrationResult.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MigrationResult.swift; sourceTree = "<group>"; };
|
||||||
|
B59AFF401C6593E400C0ABE2 /* NSPersistentStoreCoordinator+Setup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSPersistentStoreCoordinator+Setup.swift"; sourceTree = "<group>"; };
|
||||||
B59D5C211B5BA34B00453479 /* NSFileManager+Setup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSFileManager+Setup.swift"; sourceTree = "<group>"; };
|
B59D5C211B5BA34B00453479 /* NSFileManager+Setup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSFileManager+Setup.swift"; sourceTree = "<group>"; };
|
||||||
B5A261201B64BFDB006EB6D3 /* MigrationType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MigrationType.swift; sourceTree = "<group>"; };
|
B5A261201B64BFDB006EB6D3 /* MigrationType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MigrationType.swift; sourceTree = "<group>"; };
|
||||||
B5BDC91A1C202269008147CD /* CartFile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CartFile; sourceTree = "<group>"; };
|
B5BDC91A1C202269008147CD /* CartFile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CartFile; sourceTree = "<group>"; };
|
||||||
@@ -669,6 +671,7 @@
|
|||||||
B5E84F321AFF85470064E85B /* NSManagedObjectContext+Setup.swift */,
|
B5E84F321AFF85470064E85B /* NSManagedObjectContext+Setup.swift */,
|
||||||
B5E84F331AFF85470064E85B /* NSManagedObjectContext+Transaction.swift */,
|
B5E84F331AFF85470064E85B /* NSManagedObjectContext+Transaction.swift */,
|
||||||
B51BE0691B47FC4B0069F532 /* NSManagedObjectModel+Setup.swift */,
|
B51BE0691B47FC4B0069F532 /* NSManagedObjectModel+Setup.swift */,
|
||||||
|
B59AFF401C6593E400C0ABE2 /* NSPersistentStoreCoordinator+Setup.swift */,
|
||||||
B5E84F2D1AFF849C0064E85B /* WeakObject.swift */,
|
B5E84F2D1AFF849C0064E85B /* WeakObject.swift */,
|
||||||
);
|
);
|
||||||
path = Internal;
|
path = Internal;
|
||||||
@@ -985,6 +988,7 @@
|
|||||||
B5FAD6AC1B51285300714891 /* MigrationManager.swift in Sources */,
|
B5FAD6AC1B51285300714891 /* MigrationManager.swift in Sources */,
|
||||||
B5E84EF61AFF846E0064E85B /* DataStack+Transaction.swift in Sources */,
|
B5E84EF61AFF846E0064E85B /* DataStack+Transaction.swift in Sources */,
|
||||||
B5E84EDF1AFF84500064E85B /* DataStack.swift in Sources */,
|
B5E84EDF1AFF84500064E85B /* DataStack.swift in Sources */,
|
||||||
|
B59AFF411C6593E400C0ABE2 /* NSPersistentStoreCoordinator+Setup.swift in Sources */,
|
||||||
B5E834BB1B7691F3001D3D50 /* Functions.swift in Sources */,
|
B5E834BB1B7691F3001D3D50 /* Functions.swift in Sources */,
|
||||||
B5E84F231AFF84860064E85B /* ListMonitor.swift in Sources */,
|
B5E84F231AFF84860064E85B /* ListMonitor.swift in Sources */,
|
||||||
B5E84EF71AFF846E0064E85B /* UnsafeDataTransaction.swift in Sources */,
|
B5E84EF71AFF846E0064E85B /* UnsafeDataTransaction.swift in Sources */,
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ internal extension NSManagedObjectModel {
|
|||||||
fatalError("Could not create an \(typeName(NSManagedObjectModel)) from the model at URL \"\(modelFileURL)\".")
|
fatalError("Could not create an \(typeName(NSManagedObjectModel)) from the model at URL \"\(modelFileURL)\".")
|
||||||
}
|
}
|
||||||
|
|
||||||
@nonobjc private(set) internal var currentModelVersion: String? {
|
@nonobjc internal private(set) var currentModelVersion: String? {
|
||||||
|
|
||||||
get {
|
get {
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ internal extension NSManagedObjectModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@nonobjc private(set) internal var modelVersions: Set<String>? {
|
@nonobjc internal private(set) var modelVersions: Set<String>? {
|
||||||
|
|
||||||
get {
|
get {
|
||||||
|
|
||||||
|
|||||||
64
CoreStore/Internal/NSPersistentStoreCoordinator+Setup.swift
Normal file
64
CoreStore/Internal/NSPersistentStoreCoordinator+Setup.swift
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
//
|
||||||
|
// NSPersistentStoreCoordinator+Setup.swift
|
||||||
|
// CoreStore
|
||||||
|
//
|
||||||
|
// Copyright © 2016 John Rommel Estropia
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
// of this software and associated documentation files (the "Software"), to deal
|
||||||
|
// in the Software without restriction, including without limitation the rights
|
||||||
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
// copies of the Software, and to permit persons to whom the Software is
|
||||||
|
// furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included in all
|
||||||
|
// copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
// SOFTWARE.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
import CoreData
|
||||||
|
|
||||||
|
|
||||||
|
// MARK: - NSPersistentStoreCoordinator
|
||||||
|
|
||||||
|
internal extension NSPersistentStoreCoordinator {
|
||||||
|
|
||||||
|
// MARK: Internal
|
||||||
|
|
||||||
|
internal func addPersistentStoreSynchronously(storeType: String, configuration: String?, URL storeURL: NSURL?, options: [NSObject : AnyObject]?) throws -> NSPersistentStore {
|
||||||
|
|
||||||
|
var store: NSPersistentStore?
|
||||||
|
var storeError: NSError?
|
||||||
|
self.performBlockAndWait {
|
||||||
|
|
||||||
|
do {
|
||||||
|
|
||||||
|
store = try self.addPersistentStoreWithType(
|
||||||
|
storeType,
|
||||||
|
configuration: configuration,
|
||||||
|
URL: storeURL,
|
||||||
|
options: options
|
||||||
|
)
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
|
||||||
|
storeError = error as NSError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if let store = store {
|
||||||
|
|
||||||
|
return store
|
||||||
|
}
|
||||||
|
|
||||||
|
throw storeError ?? NSError(coreStoreErrorCode: .UnknownError)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -37,8 +37,5 @@ internal final class WeakObject {
|
|||||||
self.object = object
|
self.object = object
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal private(set) weak var object: AnyObject?
|
||||||
// MARK: Private
|
|
||||||
|
|
||||||
private(set) weak var object: AnyObject?
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -854,7 +854,7 @@ public final class ListMonitor<T: NSManagedObject> {
|
|||||||
/**
|
/**
|
||||||
Returns `true` if a call to `refetch(...)` was made to the `ListMonitor` and is currently waiting for the fetching to complete. Returns `false` otherwise.
|
Returns `true` if a call to `refetch(...)` was made to the `ListMonitor` and is currently waiting for the fetching to complete. Returns `false` otherwise.
|
||||||
*/
|
*/
|
||||||
private(set) public var isPendingRefetch = false
|
public private(set) var isPendingRefetch = false
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Asks the `ListMonitor` to refetch its objects using the specified series of `FetchClause`s. Note that this method does not execute the fetch immediately; the actual fetching will happen after the `NSFetchedResultsController`'s last `controllerDidChangeContent(_:)` notification completes.
|
Asks the `ListMonitor` to refetch its objects using the specified series of `FetchClause`s. Note that this method does not execute the fetch immediately; the actual fetching will happen after the `NSFetchedResultsController`'s last `controllerDidChangeContent(_:)` notification completes.
|
||||||
|
|||||||
Reference in New Issue
Block a user